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
-
0
votes1
answer89
viewsJava.lang.Nullpoinerexception when trying to insert database data into a Jcombobox
Today my team and I came across a problem trying to do something seemingly simple: display a clerk’s surname in a Jcombobox. The problem is that when opening the screen we receive a…
-
0
votes1
answer30
viewsHow to Properly Organize Tables in a System
I am developing a system for a school where the teacher will create the proof by the system, I have 3 entities: Proof, Question, Alternative, I would like to know the best way (in the database) to…
-
0
votes1
answer107
viewsRestore dump with nodejs
Precise restore a postgres database nodding... My routine downloads the latest backup (custom dump) by ftp, and creates the database (without the structure). Now I need to run this file I downloaded…
-
0
votes0
answers193
viewsHow to Optimize Java Connection with Postgres
My connection class with the database is taking too long to open the connection, it takes almost 20 seconds. Hibernate Usage and the Bank is Postgres running localhost. Am I doing something wrong?…
-
0
votes2
answers150
viewsSelect with IN operator in array column in Postgres
Good evening, everyone! I have a column (ids_authors) which is an array of integers in a Postgres table. I am trying to make a select with the IN operator in this column, but it is giving error. I…
-
0
votes1
answer55
viewsShell Script for Postgresql Download
I am writing a code in Shell Script to download the source code of the last updated version of Postgresql checking the current version automatically. So based on that I did the following: created…
-
0
votes1
answer45
viewsUpdating a JSON-like column in Postgres with Python and Psychopg2
When trying to run an update like the below in postgres via psycopg2 of Python is giving the error: psycopg2.Programmingerror: can’t Adapt type 'Dict' I’m trying to run a code like this:…
-
0
votes0
answers37
viewsHow to Catch a Week Back from Today at Postgress
I’m trying to make a select to pick a week back from today. That’s what I’ve come up with? select count(id) as total, (current_date - interval '7') as testando, extract(day from data_cadastro) as…
postgresqlasked 5 years, 8 months ago everton machado 1 -
0
votes0
answers61
viewsMemory Leak error in connection drivers when trying to launch Tomcat
I have a Java/Vraptor4 application on a Tomcat9.0 , when I am climbing up Tomcat the following error is released: abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log…
-
0
votes1
answer207
viewsProblems with accentuation in Postgresql and PHP characters
Hello! I’m having trouble saving data from a PHP form in Postgresql. Currently the database is LATIN1 and the pages are with Charset in UTF8. However I have tested with Postgresql in UTF8 and the…
-
0
votes2
answers87
viewsPostgres SELECT FROM
$sql = $Pdo->prepare('SELECT * FROM "Test"." $People"'); Guys I’m trying to give a select using a variable but I need to keep the quotes because I’m working with postgres and it requires the…
postgresqlasked 5 years, 6 months ago Tecnologic Brasil 13 -
0
votes1
answer31
viewsQuery SQL Help
select T.n_acid,T.marca from (select n_acid, veic_seguro, marca from marca_acid as ma, veiculo as v where ma.veic_seguro = v.n_veic) as T group by T.n_acid, T.marca; This query returns the table…
-
0
votes1
answer136
views"The Java Exception has ocurred" error while running the Postgre JDBC driver
Follow my problem: 1 - I am using the Postgre 9.6 database. 2 - I downloaded and opened in ECLIPSE a project with example Java application with the use of Hibernate and Postgre that the teacher…
-
0
votes1
answer382
viewsError : "No Persistence Provider for Entitymanager"
I have a project in Eclipse with an application that persists in the Postgresql 9.6 database through Hibernate, but Java is not recognizing the "persistence-Unit name" which is set in the…
-
0
votes0
answers24
viewsExternal Connection Postgresql
I have a java application on my computer running offline along with a database connection, with full access. I wonder how I would do so that if this program is installed on another computer, the…
-
0
votes1
answer69
viewsPython reading database postgres
In python I use callproc to perform a function done in the postgres database. It works well if you access the bank by the user with full permission. But error occurs when accessing with private user…
-
0
votes1
answer63
viewsA table just to store images or split by types?
I want to register users, where they should put their profile photo and inside the program, store other images, I better make a table only for all photos or split for each type? I saw some places…
-
0
votes1
answer121
viewsHow to use LIKE with knex/postgres?
I need to perform a consultation via knex, for a postgres bank, using the LIKE tag as below: function getPessoas(nomeIncompleto){ return db('tab_pessoas').where('nomePessoa', 'like',…
-
0
votes1
answer27
viewsCompare products for years in different columns of the same table
Good afternoon! I would like to perform a select in sql that solves the following question: I have a sales table related to one of products, however, I want to compare the results of the same…
postgresqlasked 5 years, 5 months ago Lucas Henrique 11 -
0
votes0
answers34
viewsCursor with Postgresql
I have here a table of proceedings that activates a Trigger when a new procedure is recorded. In my case, when someone generates a process for a request that has been returned the system must…
-
0
votes1
answer22
viewsPostgresql query bringing more results than expected
Hello, I have a situation in a system where I need to find out which student enrollments are related to a tutor in a class. The tables I have are: matricula containing foreign key with student…
-
0
votes1
answer48
viewsWhy does the Crosstab function not work in Windows? Using Postgresql
I built a query that has a Crosstab, in the database manager works perfectly and gives no error, but when I run this query inside my project that is in Laravel, it explodes an error saying that the…
-
0
votes0
answers42
viewsError using MD5 in @Query in Springboot application
Good morning, initially I was trying to execute a query that would return a checksum: @Query(value = "SELECT MD5(STRING_AGG(atendimento::text, '')) FROM atendimento WHERE id_avaliador_fk = ?1;",…
-
0
votes1
answer168
viewsIs there an equivalent to SQLSERVER’s @ROWCOUNT in Postgres?
I am migrating the Database of some applications, from Sqlserver to Postgres and several scripts use @@rowcount. There is a Postgres equivalent to @rowcount?
-
0
votes0
answers98
viewsHow to RETURN an UPDATE from SELECT in Postgree within a Function?
I have a "FUNCTION RETURNS TABLE()" in Postgree, where I select from select, but I need to apply an update from select, but I cannot return to the table. I tried it this way and I didn’t succeed:…
-
0
votes1
answer48
viewsUpdate of an installment form query
Good afternoon, today I had a little doubt. Somewhere in my code I have a query to do an update. The function is as follows: function updateUser(user_id, params) { const query = `UPDATE users SET…
-
0
votes0
answers202
viewsHow to pass the variable on postgres using dbblink
Oops, good morning! I have the following query in postgres: declare $1 VARCHAR; BEGIN IF (SELECT COUNT(*) FROM tempo2 WHERE looping IS NULL) > 0 THEN $1 = (SELECT banco FROM tempo2 WHERE looping…
-
0
votes1
answer46
viewsTrouble joining tables with UNION
I am trying to bring the top 3 of my table and also the last 2 placed, SITE TO EXECUTE SCRIPT This is my current progress that doesn’t work SELECT ('Podium: ' ||TEAM) as name FROM LEAGUE ORDER BY…
-
0
votes1
answer35
viewsEmpty json_array attribute when persisting in BD
Boas Galeri. I have a curious problem using Doctrinefixturesbundle. I have a class Application of the kind Entity Class that maps to the table system. In this class there is an attribute called…
-
0
votes2
answers129
viewsBuild error of . jar via command line in Spring Boot/Postgresql
I have an application of Restapi studies and I am using Spring for such purpose. When compiling the jar via command line, this error appears below. I have changed driver version and not solved.…
-
0
votes1
answer20
viewsEdit the Return of a function using postgresql
Hello! I have the following function (using pgadmin and postgresql), and I would like to edit the Return so that in "data output" instead of just "The sum of the numbers is: 10", the " would be…
-
0
votes1
answer108
viewsSelect within another select using the LIKE operator
GOAL I need to make a select inside another select using the LIKE operator converting the value of the other select to LOWER, but it is returning error QUERY select * from tbl_client where "NODE"…
-
0
votes1
answer48
viewsSelect in Json data
With this select example, I get the Account information I have inside my json: select data::json#>>'{account}' as codigo, assinatura from assinante ce where assinatura in ('XXX') I can get the…
-
0
votes1
answer46
viewsDoubt how to recover data from another table with Postgres
I have two tables: Department with id and name Telephone contains id_department and extension I have already registered a department and some extensions where the id_departamento refers to the…
-
0
votes2
answers62
viewsOptimization in SQL
Is there any way to improve that stretch?
-
0
votes1
answer25
viewsMy inserts are not being saved
I installed a postgre cluster using pgpool in Docker containers, https://github.com/paunin/PostDock. I can connect to pgpool and make insertions and other normal sql commands. psql monkey_db -h…
-
0
votes0
answers56
viewsError saving Trichedit Delphi content in Postgressql
I have to record formatted texts in the Postgresql database, when I load the Richedit shows the normal text, but when saved and I will look in the database the characters so:…
-
0
votes1
answer408
viewsCan you identify whether a Postgresql command can lock before it is executed?
Sometimes I need to enter a field or index or make some more critical modification and often ask everyone to leave the base before I execute the command. This command on my machine even with the…
postgresqlasked 6 years, 6 months ago Marcelo 1,768 -
0
votes1
answer51
viewsajax result in php session
I’m filtering a Cpf/cnpj through imput/datalist and checking the result with ajax. I intend to bring the result in 2 sessions php but I’m not getting it. The page containing the filter: <!doctype…
-
0
votes1
answer187
viewsWhat is the safe way to work with Tricheedit Database?
I’m asking this question because for days I’m having a huge pain in the ass with this junk from Richedit, time he saves right time he saves a lot of ??????????????????????? at the base... I know it…
-
0
votes0
answers548
viewsProblem restoring backup with pg_restore in Postgresql
I cannot restore a backup using pg_restore, while trying to restore the process starts, but shortly afterwards it stops and says that it is "without memory" ~$ /usr/bin/pg_restore --host "localhost"…
-
0
votes1
answer42
viewsEmpty processes in the queue - Postgresql
Hello. This week we started to have a problem of empty processes in the Postgresql queue, but unlike other processes, these are locked. This is causing quite slowness in the system. I would like to…
-
0
votes2
answers1015
viewsError opening a postgres 12 database (via postbird or something like) -> column "relhasoids" does not exist
I went to create a new postgres bank via Docker using image: 'postgres:alpine' and with it he took the latest version (12.0). When opening the bank with Postbird (which has this bug) and trying to…
postgresqlasked 5 years, 1 month ago Hugo L.F. 47 -
0
votes1
answer152
viewsPostgresql result filtering from lower one column value
It is a matter of logic and knowledge of Postgresql resources. I have the following result of a query: I need to do a filtering, grouping by [hour] so that only the nearest [real time] remains and,…
-
0
votes1
answer315
viewsRuby on Rails search to generate a report
Well I have a project with scaffolds of books and loans and I need to do a search of a specific book and as a result show all the loans that that book had I have no idea how to start doing that.…
-
0
votes3
answers113
viewsIs it possible to update to 1 table using another condition?
I have the following query: update ivr_contatos,ivr_campanha set ivr_contatos.tentativas = 0 where ivr_contatos.status = 0 and ivr_contatos.tentativas >= ivr_campanha.qtdtentativas the doubt is,…
-
0
votes1
answer55
viewsI’m having some problems with GROUP BY
I’m having trouble assembling a select with the GROUP BY. What I want to do is this: I have three tables: bicos idbico, idempresa, idbomba abastecimentos idabastec, idbico, idempresa, valorabastecim…
-
0
votes0
answers52
viewsError connecting 2 postgres database with FOREIGN DATA WRAPPER
I’m trying to connect two postgre databases and I’m getting an error importing the tables: CREATE EXTENSION postgres_fdw; CREATE SERVER gestware_server FOREIGN DATA WRAPPER postgres_fdw OPTIONS…
-
0
votes2
answers1768
viewsHow to Pass Parameters in Jasperreports
Hello Guys good afternoon I’m having a doubt that is killing me. I have a project that has to print out a report that contains two lists and two tables. My problem is this, I have no intention of…
-
0
votes0
answers44
viewsCalculate time intervals in months ( Date List )
I have a Date List 01.01.2017 13-month interval 02.02.2018 period of 14 months 03.04.2019 interval of 8 months 19.12.2019 Is there any way to make a select that returns months between listed dates I…