Most voted "postgresql" questions
Postgresql is an open-source, object-relational database management system (ORDBMS) available for many platforms, including Linux, UNIX, MS Windows, and macOS. Please mention your version of Postgresql when asking questions.
Learn more…1,437 questions
Sort by count of
-
1
votes1
answer330
viewsScript to change table names in the Postgresql database
I have this script: SELECT n.nspname AS schema_name, c.relname AS table_name, c.reltuples::int AS num_reg FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_tablespace t…
-
1
votes2
answers96
viewsError importing xls to postgres
I am trying to import an XLS file into the Postgressql database, however when I run Submit on the page itself, the error below occurs: Undefined offset: 1 in C: wamp www projects... line 59 Below,…
-
1
votes3
answers684
viewsCall database function that receives a list as parameter
People like me do the following... involves database (Postgres SQL) and JPA, I want to create a database function that receives a list of ids as parameter and make a query cm enclosure WHERE IN…
-
1
votes0
answers28
viewsSelect 2 json information
I have the following select to query in the bank the sum of the values of a given day and group by cardBrand. select SUM (amount::numeric)/100, response ->> 'cardBrand' from fatura where…
-
1
votes2
answers1208
viewsselect month and year of a datetime field
I own a field of the kind datetime and I need to make a consultation based only on the month and year. While researching, I noticed that there is the function extract, but it separates only one…
-
1
votes1
answer2812
viewsConfigurations environment timezones Django postgres linux
Good morning to all. I have a website (Django) in a Linux hosting service with SQL Postgre bank that is in New Jersey (USA). Users are in Brazil, therefore I have a difference of Timezone. I’m sure…
-
1
votes0
answers458
viewsInsert Modal data into table via Ajax PHP and Javascript
I’m trying to insert data from a table of my Modal in the table "father" of my page, basically I have a modal, where I gave a select to bring the data that is not in the parent table and the user…
-
1
votes1
answer190
viewsVery Crazy Error in Postgresql X Fastreport Registry
I have several tables that do Masterdetail among themselves, I will not put the structure here because it is very complex, are 26 tables involved. The error is as follows: in a table there is a…
-
1
votes1
answer448
viewsHow to extract values from a json to insert into a table in Postgresql
I need to migrate from sql server 2017 to the postgresql,but I never used postgresql and I’m having a hard time. I need to convert a array json for values that are inserted in the table. In the sql…
postgresqlasked 6 years, 10 months ago Thiago16Oli 15 -
1
votes1
answer73
viewsMount SQL with options
I am using Postgresql in an extension system and I have here two tables. One that stores the extensions and another that stores the permission to link these extensions. This second table is…
-
1
votes1
answer167
viewsConfiguration error on JPA and Postgresql connection
I am having problems connecting JPA with Postgresql. I believe the problem is in the configuration of the application. I am using the Java 8 version, and my pom.xml file is: <project…
-
1
votes1
answer4525
viewsHow to handle Null fields in Postgresql
Hello, I need to know how to best use COALESCE to treat the null fields in my table. My problem is the following, I’m simulating 6 Stores and their respective cards, let’s assume that one or more…
-
1
votes1
answer352
viewsError trying to insert data to Postgresql
I’m having trouble entering information to the BD. I believe the error is in the DAO layer more specifically in the insert function. You could help me find this mistake? CONNECTIONFACTORY package…
-
1
votes1
answer65
viewsWhat SQL Script in Postgres to return the Functions of a Schema?
What SQL Script in Postgres to return the Functions of a Schema with its input parameters ?
-
1
votes2
answers71
viewsHow to control version number on budget?
I’m racking my brain here to get to a common denominator, I have a system in Delphi with Postgresql, this system has a budget session I need to control the changes made in these budgets by placing…
-
1
votes1
answer29
viewsSelect data even if it is not in all tables
I have the following Query: SELECT public.suprimento.suprimento, public.estoque.numeroserie, public.fornecedor.nome as fornecedor, public.estoque.data as dataentrada,…
postgresqlasked 6 years, 8 months ago R.Santos 2,251 -
1
votes1
answer415
viewsMultiple pass to simple parameter in Postgresql
I created a function in Postgresql where I sum certain accounts. However, my function has only one parameter for them: f_retorna_somatorio(p_conta character varying, p_cnpj character varying,…
-
1
votes1
answer1034
viewsHow to delete records automatically with postgresql?
Recently manage to catch a project that is a blog, the user will perform the posts of various news, however I am using the server Heroku with the free account that entitles there are only 512 Megas…
-
1
votes1
answer2741
viewspg_dump executed via windows command prompt
I executed a dump with the following script: C:\Arquivos de Programas\postgresql\10\bin>pg_dump.exe -h xxx.xxx.xxx.xxx -p 5432 -U postgres -W postgres Senha:... -- PostgreSQL database dump -- --…
-
1
votes2
answers570
viewsCreate a VIEW or a new TABLE in Postgres?
Olás! I have a situation... I have a table that will have about 3*10 12 lines (3 trillion), but with only 3 attributes. In this table will have the Ids of 2 individuals and the similarity between…
-
1
votes1
answer67
viewsHow to leave my bank in the postgres always ordered?
I’m making a page search system in which I will always make the subsequent query in the bank: 'SELECT title FROM pages ORDER BY title ASC OFFSET' +iniciaL + 'FETCH FIRST 32 ROWS ONLY' I choose an…
postgresqlasked 6 years, 8 months ago Vinicius Morais 1,293 -
1
votes1
answer42
viewsCreate a column for each row returned from Select
Yesterday I posted a question regarding how to return something even if there are no records found, and with the help of @Rovannlinhalis we managed to get the following query: with dados as ( SELECT…
postgresqlasked 6 years, 8 months ago R.Santos 2,251 -
1
votes0
answers33
viewsCreate Django app backup automatically
I developed a web application in Python and Django and I need to backup the data daily. Currently, I used the Postgres like SGBD. To perform the backup I discovered the module django-dbbackup, but…
-
1
votes2
answers134
viewsHelp to simplify query sql
I have a huge sql query: select l.no_cidadao, extract(year from l.dt_cad_individual) ano, extract(month from l.dt_cad_individual) mes, date_part('year',age(now(), l.dt_cad_individual)) diferenca…
-
1
votes0
answers351
viewsToo much delay in query only in Mysql
Here in the company we have PG and Mysql databases, these two banks are networked and are identical in both structure and data, where a "robot" mirrors them every 10 min. So far so good... It turns…
-
1
votes0
answers43
viewsHow to know how much storage was occupied by a Python/Django application?
I developed a web application with Python and Django. I would like to limit the amount of space used for each user, because in the application it is possible to insert images and documents. I use…
-
1
votes0
answers6
viewsopenlims - No appearing body on pages may be permissions setting?
Good morning, I installed Open-lims to test the system, at+e here all right, but now I come across a problem, only appear to me the header of pages without body. Everything seems okay, but for some…
-
1
votes1
answer1968
viewsHow to return a table, from a POSTGRES Function?
Hello, I’m trying to create a function in postgres, which at first is all correct, taking the return of function. When I run the function, it is returning all lines, but all only in a field as a…
-
1
votes1
answer51
viewsUser Registration, Access Date and Tables Consulted in the Postgresql database
Good afternoon guys. I know very little about Postgresql and the following demand came for me: I basically need to register in a table (within the Postgresql database itself) the user who access,…
postgresqlasked 5 years, 6 months ago Cesar Vincius de Paula Ferreir 11 -
1
votes1
answer50
viewsCorrect way to execute query in Django?
I need to execute the query SELECT pg_database_size('mydatabase'), how do I do this in Django with the SGBD Postgres? This is what I’ve tried from django.db import connection cursor =…
-
1
votes1
answer199
viewsProblems saving decimal value in Database (Laravel + Postgres)
I’m using Laravel + Postgres and I’m hoping to receive a decimal value, and in Migration I did so: $table->decimal('valor', 10, 2); When I get this amount, I get something like, $1,500.99 Before…
-
1
votes0
answers45
viewsSaving the user activity in the database(sql)
I am creating a chart to analyze the access of posts by age group by time on my site. But the site does not yet have this ability to capture the activity of the user and need to do it. My task and…
-
1
votes3
answers250
viewsHow to select only the largest drive in Sql?
I am in need of a help to search for the last move in the stock of each product. It happens that in the clause I made, he is returning me all sales related to that product, and I only need the…
-
1
votes1
answer760
viewsupdate column in table - postgresql
I’m a beginner in pgsql... I use version 9.5.0 and need to update a column every time a new record is inserted. The column shall be filled in from the values entered in area_pol and area_ofi. I am…
postgresqlasked 6 years, 7 months ago Felipe Almeida 13 -
1
votes1
answer128
viewsHow to use to_number in Postgresql with number in Brazilian format
I have a column of type text '1534,99', that is with the number in the Portuguese format. How do I use the function to_number in that case? SELECT TO_NUMBER('1534,99','9999999D99') should work if it…
postgresqlasked 5 years, 4 months ago Josir 113 -
1
votes1
answer66
viewsError url $feed->id
Hello, I am working on a system with feed scheme. Clicking on "Edit" appears the following error: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer:…
-
1
votes1
answer426
viewsHow to find an xml tag information using xPath in Postgresql?
I wanted to use the remote xPath, but I’m not sure how it works. I have a table and inside it a column that stores XML's. I would like to conduct a consultation that brings the value that is within…
-
1
votes1
answer1140
viewsERROR: column Reference "Customer" is ambiguous
GOAL I’m holding an accountant in the host name column for every customer equal to BRASILFOODS, the only thing I wanted, was for next to the count to appear the name BRASILFOODS QUERY SELECT…
-
1
votes1
answer117
viewsHow to replicate a particular bank in postgres to a particular door?
Well I have the following scenario, I need to do a replication of a bank A for bank B. Well so far I was able to make from one machine to another making the following changes: Master Machine -…
-
1
votes1
answer541
viewsIs there a way to change the field type of a query in Delphi without having to exclude and include?
I have the following situation, I use Postgresql and Zeos in Delphixe, I needed to update the component to better support LATIN1 x UTF-8, now I can work with every type of character, blz. But…
-
1
votes1
answer747
viewsProblems with encoding in Database Query
When trying to execute a SELECT, using fields that store data in the JSON structure, I see a problem with the data that may come: SELECT tbl_pf.nome, tbl_pf.adicionais::JSONB->'recebeTaxa' AS…
-
1
votes1
answer313
viewsMap relationship between tables without Foreign key
I have two tables in postgresql: schema1.immobile idt_imovel | int cod_imovel | string nome_imovel | string etc... schema2.declaration idt_declaracao | int cod_imovel | string status | string etc...…
-
1
votes1
answer109
viewsWhen the container does not know the host name?
I created a container on Docker and it tries to access a host called pgmaster. On the machine where Docker is installed I added the sequinte host: 10.0.0.3 pgmaster in the /etc/hosts. So much so…
-
1
votes2
answers360
viewsI cannot import numeric data or dates with empty fields in postgresql
When any Numeric or date type gift column is blank error occurs on import DATA TO BE IMPORTED: NU_ANO_CENSO|CO_ENTIDADE|DT_ANO_LETIVO_INICIO|DT_ANO_LETIVO_TERMINO|NU_LATITUDE|NU_LONGITUDE…
postgresqlasked 6 years, 6 months ago Rejan 11 -
1
votes1
answer69
viewsHow to generate my Postgresql Baseurl (link) that is in Heroku to integrate to my Angular front end?
My question is: how do I link (baseurl) to which my front-end access the data coming from this database (Postgresql) that is hosted on Heroku? My Heroku’s Postgresql releases this information: As…
-
1
votes2
answers201
viewsConvert from varchar to float when the string is empty and/or blank
I have a column where the strings are in the following format: "12.05%" I need to do some calculations with these values, and I am formatting the values that are acceptable for the float/double…
-
1
votes1
answer1454
viewsDifference between EXISTS and IN in postgres?
I have a doubt that I have already researched here, but for me it made no sense the explanations. I have this query: SELECT * FROM a WHERE id IN (SELECT ID2 FROM b) And this: SELECT * FROM a WHERE…
-
1
votes1
answer139
viewsError starting Postgresql - [FAILED]
I’m trying to upload the database, but when I give the command service postgresql-9.1 start appears the following message: Starting postgresql-9.1 service : [FAILED]. I went to the log file with…
-
1
votes1
answer207
viewsAdd fields in a select
As that puts the idautor and idobra in this my SELECT: CREATE TABLE Obra_Assunto ( idassunto INTEGER NOT NULL, idobra INTEGER NOT NULL, PRIMARY KEY (idassunto, idobra), FOREIGN KEY…
-
1
votes1
answer624
viewsSum values in a Select (postgres)
I have a small problem, I need to fill a gridView in C#, but my query is not adding up some values and this is causing the company code to be repeated and with the value "separate". The value I need…