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
-
2
votes1
answer90
viewsNotification on a local network with Postgresql
I would like to know how to send a simple notification to users of a local network, send a notification to all other devices with the app connected to the Postgresql database...
-
2
votes1
answer1193
viewsUpdate from comparison between two postgres tables
I have a sales chart that contains the seller’s code. However the seller’s table was all redone, with the change of id. How can I update the seller code in the sales table from the comparison…
-
2
votes3
answers1626
viewsIt is possible to collect data of the whole month in postgresql
How do I so that from a specific month I can get all data saved in the database: I think you should spend the year / month as parameter for example variable = "2016/10"; remembering that the data…
-
2
votes1
answer9012
viewsTruncate decimal places arbitrarily with Postgresql
I am making an SQL query using the function sum(). This function sums integers and fractional numbers. The problem is that it returns a double Precision with very large number. How do I limit up to…
-
2
votes1
answer236
viewsIs using the oid column in Postgresql as the primary key correct?
Postgresql creates by default the Oids column (object identifiers), you can get it by doing. select oid, * from table Problem that I have a table that has no primary key, and I want to map it in…
-
2
votes1
answer159
viewsLegacy PHP and Doctrine: Duplicate Definition of column
Good afternoon. The following error is happening: Error: Duplicate Definition of column 'numg_usuario' on Entity 'Usuario' in a field or discriminator column Mapping. My User class extends from…
-
2
votes2
answers279
viewsSyntax for INTERVAL use
I have the following excerpt from a CASE in my SQL SELECT CASE WHEN (tabela01.data_abertura - INTERVAL tabela02.garantia 'month') <= tabela01.data_nf THEN 'Dentro do Prazo' ELSE 'Fora do Prazo'…
postgresqlasked 8 years, 3 months ago William Aparecido Brandino 848 -
2
votes3
answers392
viewsUPDATE SUM +1 to decimal
I need to assemble a UPDATE in a table however, in the value field: '1481126826.2363343', I need this number to turn '1481126826.2363344' To query that I’m trying and the next : UPDATE…
postgresqlasked 7 years, 11 months ago Rafael Calino 111 -
2
votes1
answer84
viewsManipulate . txt file in Ruby and pupular BD?
I need to open a file. txt whatever has a string sequence separated by ";" and needs to be placed each ";" on a vector to then create a loop and insert it into the database. What do I have: require…
-
2
votes2
answers2208
viewsSQL to compare hours and minutes when Timestamp in Postgresql
I am trying to compare 2 timestamp fields, which have different dates, ignoring the dates and using only the hour/minute simultaneously, to know, within a same day which of them is bigger. EX:…
-
2
votes3
answers76
viewsIs there any difference in performance depending on what you seek?
There is some difference in performance when searching the database, depending on the number of characters reported in the query? For example, if a query is made for any record that has the…
-
2
votes1
answer94
viewsWHERE in bigint field[]
I have to perform a query to know if the code of a group is in the permissions to see the field. SELECT * FROM callcenter.pausa WHERE habilitado = 1 AND permissao_ver::varchar ilike '%1%' ORDER BY…
-
2
votes1
answer445
viewsGroup query by similar but non-identical records
I need to migrate a database (from SQL Server for PostgreSQL and I’m creating a ETL interactive in PHP to make this change), which is about 10 years old, about 2 million records in the clientes that…
-
2
votes1
answer80
viewsWhat Types of Postgis Data Are These
In the Postgis 2.3 documentation in Part 4.2 Postgis Geography Type, it is mentioned that the following types are supported. POINT LINESTRING POLYGON MULTIPOINT MULTILINESTRING MULTIPOLYGON…
-
2
votes1
answer180
viewsPersisting in Database from a file
What would be the most efficient way to read a file and write to the Postgres database? I’m posting a code where I can do, but postgres limits me on the connection number. Now follow the error: Set…
-
2
votes2
answers3637
viewsFilter records by month and year in Laravel
I have a form with a field like month, that sends a value in the format Y-m for my controller. How do I search the records for the selected month and year? I’m using L5-Repository I did it this way,…
-
2
votes1
answer77
viewsC library Function in Postgresql
I am using Visual Studio 2015 to create a function in a dll, and when I try to use it in Postgres, I get the following message: server closed the Connection unexpectedly This probably Means the…
-
2
votes5
answers14274
viewspsql command at prompt. (postgresql database)
Good morning, everyone, I’m trying to make a script with extension. bat to make automatic update in the bank,. I am doing as follows to access my bank through windows pronpt. psql -U bank user -w…
-
2
votes1
answer290
viewsMYSQL to POSTGRESQL via SED
I am looking for a way to migrate my backup from a Mysql database to Postgresql. The simplest way I found was using sed upon backup, but it hasn’t worked. It was like this: 1 - performing a backup 2…
-
2
votes1
answer185
viewsError of Postgresql variables
I am migrating an application from Firebird to Postgresql, I was able to connect the Postgresql database with the help of Devart tool, but now whenever I try to make some access in the application…
-
2
votes1
answer203
viewsError trying to update Clientdataset Fields in Delphi 7
I’m migrating an application from Delphi 7 that used to be in FireBird and now I’m connecting to the bank PostgreSQL, but a variable error was occurring, with the help of the Stack people, I…
-
2
votes2
answers212
viewsError in Trigger
I am making a system that deals with monitoring cattle and I have a question about creating triggers after update. The situation is as follows: in my bank there are several tables that have foreign…
-
2
votes1
answer196
viewsStack Underflow Error and Access Violation Delphi 7
I am changing the database of my Delphi application from Firebird to Postgresql, but at some points of my application when I am accessing Database information the following error message occurs: But…
-
2
votes1
answer123
viewsCreate a list of ruby on Rails features
I’ve been trying for a few days but I haven’t been able to solve my problem. I need to create a list of features for an item and then list them all. I wish you could help me or give me some tutorial…
-
2
votes3
answers102
viewsTake Report with zero months
I have a query in which I take monthly deposited values it takes everything it has in the base and shows the months that were entered in the base. I would like to do different I would like to show…
-
2
votes2
answers1598
viewsHow do Postgres create a file to populate a bank?
I have a database in POSTGRESQL populated , I wanted to know if there is a command SQL that returns an aqruivo that had the following command for all existing tables: INSERT INTO aluno(id , nome,…
-
2
votes4
answers5462
viewshow to insert picture into database
What type of variable do I use to store an image in the database? And is there a specific command for this? or just enter as any record? i have a project in the moon language ( mobile by Corona sdk…
-
2
votes1
answer575
viewsProblem when doing Table Insert in Postgresql
When I’m gonna make a INSERT: INSERT INTO categoria (cat_descricao,cat_status) VALUES ('não' ,'1' ) passing some element with accentuation parameter the following error occurs ERROR: 22021: invalid…
-
2
votes1
answer463
viewsQuery using order by slowly
I have a query like this: select ae_id from app_event join trip_item on ti_id = ae_trip_item_id where ae_driver_id = 63 order by ae_date desc limit 10; The table app_event has about 3 million data,…
postgresqlasked 7 years, 4 months ago Jonathan 1,073 -
2
votes1
answer3030
viewsWhat is the difference between serial and integer data types in Postgresql?
I am creating a database in Postgresql and hit the doubt as I can create in the table the field ID with AUTO_INCREMENT, searching the internet I found some examples with the field ID with SERIAL…
-
2
votes2
answers67
viewsHow to perform an arithmetic operation by changing numerous database fields efficiently?
There is a table with 200 records and one of the fields is responsible for indicating the order that these data are shown (0, 1, 2, 3, 4, 5, ...). I need to rearrange this data, take the record from…
-
2
votes1
answer694
viewsMult Mapping Dapper
I am having problems with Mult Mapping of Dapper, when I try to execute the following query is not mapping the object ids select is this: var sql = @" SELECT ofi.id_oficina, ofi.codigo, p.id_pedido,…
-
2
votes2
answers5477
viewsHow to remove the first character from a string in a Query
In the Postgresql 9.2 I have a column with the following information: A101 B12 C3 I need one command to select and another to update this column by removing the first character thus: 101 12 3 I…
-
2
votes3
answers535
viewsFinding pg_dump and pg_restore (Postgresql) on my C#PC
To perform the backup and Restore in a Postgresql database using C# you need to locate some files like the pg_dump and pg_restore. How do I make a function so that it is possible to find the files?…
-
2
votes1
answer42
viewsReducing line quantities in a query
In my system I have 3 tables: -Table Film - a film features several artists -Artista Table -Table Participates in film - this table, contains the ID’s of the movie and artist table. When I want to…
-
2
votes2
answers1562
viewsImport JSON to Database
I have a json file, and I’d like to import it into a database. Is there any way to automate this process? There is no preference for database, but if you had any function for Postgresql would be…
-
2
votes1
answer1171
viewsSave image to POSTGRES database with DELPHI Tokyo by Android App
I need to save a photo that is taken on the tablet camera and save it in the database. The field type is typea. I’m using the Timage component to view and reference the image, but I can’t save it to…
-
2
votes1
answer74
viewsHow to keep a record in the database, however, hidden to the system?
I have an application in Delphi and need that in this application when the user deletes a record, this record continues in the database, but is hidden in the system.
postgresqlasked 7 years, 1 month ago Closmaq Suporte 31 -
2
votes1
answer3317
viewsError trying to migrate bd from Laravel to Postgresql
I’m using Postgresql "5.4.*" Using Mysql, after the php artisan migrate tdo ok. But now I need to use Postgresql in the project, but after changing the DB: DB_CONNECTION=pgsql DB_HOST=127.0.0.1…
-
2
votes1
answer951
viewsHow to do pg_dump remotely
I have a server on Amazon with small storage space, I need to back up on my personal machine. if I log into the server and run pg_dump -h localhost bd > backup.sql everything works, however the…
-
2
votes1
answer527
viewsHow do select in postgres from an html field and use the return to fill in the other fields?
Basically I have no experience with html, php or javascrip and I’m trying to turn myself into what you ask me here. The problem is this: I have to make a registration page where the user selects a…
-
2
votes2
answers467
viewsDuplicate Select Postgresql output
I have a record that is a receipt, and in select, I want the line to come duplicated. Ex: Select * from recibos where codigo =1; Upshot: codigo|cliente|valor|emitente|data 1 Fulano 10 Ciclano…
-
2
votes2
answers2740
viewsAdding up POSTGRESQL values
I have a table historicos: historicos id | problemas | total | data ---|-----------|-------|------------ 01 | 25 | 125 | 2017-01-01 ---|-----------|-------|------------ 03 | 25 | 125 | 2017-03-01…
postgresqlasked 7 years, 7 months ago Marcos Henzel 797 -
2
votes1
answer411
viewsHow to do a query in sql that returns data from a table when the data is empty?
Well, I created a table called installments, that when the customer pays it is inserted 'PAID' in the column situation, and when not paid it remains blank. I wanted to fetch the information from…
-
2
votes4
answers3710
viewsDoubt with month and year extraction in Postgresql date
I am using a select command where I take the month and year of the date as follows: extract(year from D.dt_ficha) + extract(month from D.dt_ficha) Only instead of showing up like this: 201711…
-
2
votes2
answers1472
viewsTrigger that updates record in a table
I need to update an X table whenever there is a change in table Y. I have found numerous examples of how to save the changed records in table Y, both when deleting a record from table X and when it…
-
2
votes1
answer8231
viewsConnect Springboot with Postgresql
I’m trying to connect the bank with Springboot and I’m thinking my problem is here: # =============================== # = DATA SOURCE # =============================== # Set here configurations for…
-
2
votes2
answers548
viewsRows in Columns (SQL)
I’ve been thinking for a few days about how to make a select less verbose, turning rows into columns. Today I have it that way: (SELECT s.code_sample FROM app_sample s WHERE s.id_analysis = a.id AND…
-
2
votes2
answers190
viewsPostgresql COUNT function does not work
The problem is simple but I can not understand where I am missing, I need to check the amount of results of the following sql: SELECT f.id,sum(p.valor) as valor_fatura, f.valor_desconto as desconto,…
-
2
votes1
answer451
viewsIs it possible to query "INSERT INTO table SET field = 'value' " in Postgresql?
It is possible to run the query INSERT INTO nome_tabela SET nome_campo = 'aaaa' in the Postgresql database. I had to migrate a virtual store made in PHP with bank Mysql, for Postgresql. The bank…