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
answer94
viewsFirst and Last record including night
I have the following problem I have the data that way: codigo data_hora nome_ajudante -------+----------------+-------------- 1000004 2018-08-22 11:11 Carlos Eduardo 1000004 2018-08-22 11:43 Carlos…
-
2
votes1
answer7520
viewsQt SQL - ERROR (42601): syntax error at or near
I am currently developing a program to assist in the management of a barracks in my city, I am using Qt to create the graphical interface and other libraries needed as the manipulation of databases,…
-
2
votes3
answers89
viewsproblem with select case
I am selecting with case comparing different status of the same field and counting them in separate columns. The problem is that the first column is NULL until the list of the second finishes…
-
2
votes1
answer288
viewsQuery two or more words in a string
I need to make mine select bring only records whose description has the words "RACAO" and "ROYAL". I’m using Regex to make it easier, but I don’t know why you’re bringing in records that have…
-
2
votes2
answers311
viewsReturn Value ID C# Npgsqlcommand
After inserting a row of information in a given table, I need to recover the ID value to fill my object, my code is like this: using (NpgsqlConnection pgsqlConnection = new NpgsqlConnection(conn) {…
-
2
votes2
answers44
viewsDoubt in Postgresql function
I am doing a function in Postgresql and I want to use it to check if a table already exists or not in a database and, if not, I want to create a table. The problem is in the function declaration,…
-
2
votes1
answer147
viewsGroup empty case when sql cells
I am making a query in the database to know in which branch the customer paid a installment and what is the normal value and interest that were paid. The value of the tranche is transaction 3 at the…
-
2
votes0
answers36
viewsUsing Nlog with Postgresql C#
I am working on an application, and have some log screens, and I want to add a log routine in the API of these records, type: do not add, update and error occurrences (if any). The database that is…
-
2
votes0
answers80
viewsHow to map entity using Dapper with postgres
I’m having a big challenge here and I can’t seem to solve it. I’m working with DDD and on the layer of Infra esotu using Dapper When trying to execute the following code on RepositorioUsuario:…
-
2
votes1
answer75
viewsDoes it matter to delete and create new lines or update old ones?
Not taking into account the technical difficulty of doing one thing or another, but rather the consistency of the bank, the speed of subsequent operations and the professionalism. If I have a…
-
2
votes0
answers77
viewsProblem running a function in Asp.net.core.webapi + postgresql + npgsql+Dapper
I have a Webapi in Asp.net core, using postgresql as a database. Inside postgresql, I have the following function: CREATE OR REPLACE FUNCTION evento_distancia( IN lat numeric, IN lng numeric, IN…
postgresql asp.net-web-api asp.net-core dapper npgsqlasked 5 years, 8 months ago Thiago Oliveira 147 -
2
votes1
answer50
viewsReturn database value to e-mail
Hello! I have a question here, I’m doing a function that takes the data from the Database and sends an email with them, for example: 'Hello {{Name}}'. ({{Name}}) It would be the field that would…
-
2
votes3
answers208
viewsHow to configure Settings.py to use Django-tenant-schema?
I need to configure my Django to run llb django-tenant-schema My project does not create schemas and soon I cannot synchronize my bank with the project. I’m having trouble understanding how you are…
-
2
votes1
answer114
viewsRelating distinct foreign keys in a column?
Hello, I am creating a table to register materials or services that depend on two other tables to form your cost center (Foreign key), depending on the type of registration. If I’m going to register…
-
2
votes1
answer83
viewsWhat would be the ideal unique natural key associated with a person?
I’m developing a system whose one of the tables represents people. Of course, the most accurate document to represent only one person is CPF. However, the system provides for the possibility that…
-
2
votes1
answer153
viewsLaravel, when performing a query per model, how to say that a hasManyThrough relationship must contain these items?
Well, I found myself in the following situation, I own the entities Vehicle, Vehicle and Optional, where Vehicular is a pivot between the two. Beauty, there is a vehicle filter on the main page…
-
2
votes0
answers81
viewsCalculation of Due Dates Based on Number of Plots Chosen
In a function I want to put the parameters that would: Number of Plots and Total Value My problem would be how to generate maturity dates of installments in Postgresql how to work with the dates to…
-
2
votes1
answer340
viewsUnable to install Npgsql 4.1.2 package. application . NET Framework
I’m trying to install the Npgsql to consume Postgresql data in my project , but returns me the error below: Severity Code Description Project File Line Suppression State Error Could not install…
-
2
votes0
answers54
viewsQuery Existence of PSQL Table
Well, I searched many places until I found the answer to my problem and I found interesting the idea of posting here what I found to help Unity, in case someone needs to perform a similar CRUD,…
-
2
votes2
answers48
viewsSQL showing records if they only meet different conditions than usual
I have a slightly different situation, tried different conditions but none brought the desired result. My need is this: I have a base containing authors of books and their respective works. I need…
-
2
votes3
answers95
viewsHow do I leave the primary and foreign key of a table with the NOT NULL Constraint in Postgresql?
I am creating primary and foreign keys with the NOT NULL Constraint in Postgresql, only the way I am doing this is going in the properties in the table and manually setting the keys as NOT NULL, I…
-
2
votes1
answer201
viewsSELECT MAX With more than three columns
I have the following table: jobname aplicacao start end tempo_de_execucao PROCESSO_C APLICACAO_C 3/4/2020 3:01 3/4/2020 5:39 2:37:26 PROCESSO_E APLICACAO_D 3/4/2020 6:00 3/4/2020 6:41 0:40:51…
-
2
votes0
answers377
viewsHow to run Typeorm Migrations on Heroku?
By putting my code into production at Heroku, Migrations database are not running. How could I run them once I start my application? Postgresql is the database used. Archive of database…
-
2
votes1
answer363
viewsTypeorm query with Inner Join is coming empty
I made two tables, Usuario 1 : N Produto I made an Inner Join with Typeorm, but an empty array was coming, so I took the query it was generating to analyze it better. When I played the query in…
-
2
votes0
answers152
viewsOnetomany / Manytoone Typeorm relationship is not saving the foreign key. The value goes as NULL
Well, I’m using Typeorm in my TCC project. It’s something very simple, nothing very complex. I am using Postgresql to save the data, in the database I have only two tables, a call users and another…
-
2
votes1
answer55
viewsInserting CSV into Postgresql with Nodejs
I want to insert a CSV into a postgresql table. CSV contains rows with multiple column numbers. Ex: 1,2,3 1,2,3,4,5 1,2,3,4,5,6 1,2,3,4 When performing the insertion, the following error occurs:…
-
2
votes1
answer95
viewsHow to insert JSON values in Postgresql using Nodejs?
I intend to perform an Insert in a table in Postgresql. The values that will be used in the query are from a JSON in which I have access through a GET. fetch(…
-
1
votes3
answers864
viewsDifference between ways to perform a backup (Disk space, buffer, etc.)
Suppose I have a machine with 10GB free disk space, and I have a backup script from a database postgresql, that when run, it backs up locally and just after finished, copies to another remote…
-
1
votes1
answer976
viewsPostgresql - Add existing values for the current month
Good staff I have a table with column dates of certain records. I know that to sum up the records of a given day: SELECT SUM(CAST(REPLACE(coluna1,',','.') AS DOUBLE PRECISION)) FROM tabela1 where…
-
1
votes1
answer1873
viewsProblem when inserting data into postgresql with jpa implemented by Hibernate
Good afternoon I would like to know why this error is happening, the project is with all the jars in the lib and in the path but when I will insert is returning me an error. Apr 19, 2014 4:49:27 PM…
-
1
votes2
answers396
viewsHow to create a stored Postgresql database from a Java source
Searching the internet for a solution to create a database on a Postgresql server for my Spring project, I found the following topic on Stackoverflow:…
-
1
votes1
answer159
viewsTrade ids by include in gallery shortcode in Wordpress
I am using Postgre and when creating image galleries the shortcode is generated automatically like this: [gallery ids="1,2,3,4,5"]. But this database does not accept 'ids', I must put 'include', so:…
-
1
votes1
answer7703
viewsProblems with Constraints in Postgresql
I’m going through a problem with Postgresql, 8.1. When adding constraints it returns this error: SQL error: ERROR: there is no Unique Constraint matching Given Keys for referenced table "called"…
-
1
votes1
answer78
viewsAdd items from table 1 and bring in indexed Rows from table 2
I am very new with SQL and I am creating an application that brings the number of hours contracted, well the part that I have doubts in the query is the index of lines... I need the rows not to…
-
1
votes1
answer1326
viewsUsing Postgres on Android with Asynctask
I want to connect my android app direct with the bank that is on a server. I made the connection in an Asynctask, follows the code. public class ConnectionTask extends AsyncTask<Object, Object,…
-
1
votes4
answers1530
viewsProblem with sorting in Postgresql
I’m having a problem sorting columns in Postgresql despite being configured correctly in UTF-8. The version of Postgresql is 9.3 and it is installing on a Macosx Maverick 10.9.5 (this problem has…
-
1
votes1
answer39
viewsConfiguration of XML
In the configuration of pMapper (Mapserver framework for PHP), there is this configuration which I am in doubt how to configure it. <dsn…
-
1
votes1
answer681
viewsPDO Insert does not work
Before you ask me the question, I have consulted other topics here in the OR and found no solution. I’m trying to make a simple Insert and as soon as I run the whole script just doesn’t happen, the…
-
1
votes2
answers2812
viewsDecimal variable removing decimal places
I have a variable in decimal which receives a value of a textbox, but when this variable receives the value with decimal places it removes the decimal place and stores the value without the same.…
-
1
votes1
answer1607
viewsTrigger for a Select
I would like to know if it is possible to execute a Trigger when a SELECT is performed in a given table, for example: CREATE TABLE IF NOT EXISTS "Conversa" ( "idConversa" SERIAL NOT NULL,…
-
1
votes1
answer144
viewsRecovering badly formatted string when it contains accented words
In my application I am having trouble fetching the data in the Postgresql database, the words with accentuations when retrieved from the database and dealing in DataReader are coming badly formatted…
-
1
votes1
answer648
viewsUnilateral replication in Postgresql
I have two servers. One is only and exclusively for testing. The other is for production itself. I need the test database to contain the same data from the production database. I can’t do a mirror,…
sql database postgresql synchronization replicationasked 9 years, 9 months ago Pedro Vinícius 1,870 -
1
votes0
answers306
viewsHow not to initialize postgresql with Ubuntu?
When I execute the command sudo service postgresql status appears the following information: 9.3/main (port 5432): online How do I get Postgresql to stop booting together with the OS (Ubuntu 14…
-
1
votes1
answer361
viewsAlways include records from the other table if the value of the related field is not NULL
I’m doing a query query, based on a table. In this table (Tablea) I bring several records from other tables, with some codes but one in particular is giving me a certain headache. There is a record…
-
1
votes1
answer1837
viewsSelect Rows in a Postgresql array
I am using the Postgresql and Python database to query it, I have the following modeling: I’m trying to make an appointment that will return all the OrderItems of a Order in a array, for that I made…
-
1
votes1
answer86
viewserror when converting an Oracle precedent into a Postgresql function in pl/pgsql
I adapted the code, but there is the following error : ERROR: relation "fields" does not exist CONTEXT: compilation of PL/pgsql function "p_grava_log" CREATE OR REPLACE FUNCTION F_GRAVA_LOG ( TIPO…
-
1
votes3
answers354
viewsReturn the last entry of different Postgresql objects
Supposing I have two tables: Car containing: plate, year, ect.. Event containing: car, lat, long, date, time, etc.. How could I return only the last entry of each car in the event table?…
-
1
votes3
answers1548
viewsselect text field separated by comma return lines
Does anyone know how it is possible in postgresql take a value within a field of type TEXT which has comma-separated records to use in the WHERE? Example of field values…
postgresqlasked 9 years, 8 months ago Jorge Kania 192 -
1
votes0
answers292
viewsReplication in postgres 9.4
Good evening guys. I’m trying to do a replication on postgresql 9.4. I made the settings exactly the same as the files postgres.conf and pg_hba.conf in the master and in the slave, only when I drop…
postgresqlasked 9 years, 8 months ago Carlos Leandro Ferreira de Alm 339 -
1
votes1
answer109
viewsreplication error
I’m trying to use a command on shell in Postgresql(Windows) with the following syntax: select pg_start_backup('nome do meu banco de dados', true); It responds to a record. Now, when I type the…