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
votes2
answers40
viewsReturning the total with the date in a query with the SUM
I need to return a sum of the value field of the table m and together with it the date of the initial field of the field sale_date, and showing Aggregate Function error: SELECT sum(m.value),…
-
0
votes0
answers170
viewsHow to create method to print a report - java
How do I create a way to print a DB report. Follow my method below. public void printReport (Date initialDate, Date endDate){ list<Sale> sales = getSales (initialDate, endDate); for (Sale…
-
0
votes1
answer181
viewsCreate query to return the smallest possible value
Good night. I need to do a sales report grouped by period and by card. But I do not know how to enter a store and horizontally of it appear the values of each card. Example of how the output should…
-
0
votes1
answer51
viewsSelection of SQL related records
I have two tables, one that calls grupo where groups created for access to an application are stored. For example, if you have in the group CADASTRO_ADMIN, you will have full permission; now, if you…
-
0
votes1
answer161
viewsImport txt to postgresql
I created the following txt file: 'Granada', current_timestamp 'Grecia', current_timestamp 'Guatemala', current_timestamp 'Guiana', current_timestamp 'Guine', current_timestamp 'Guine Esquatorial',…
postgresqlasked 7 years, 3 months ago MagShania 353 -
0
votes1
answer170
viewsProblems with "libpq.so. 5": Wrong ELF class: ELFCLASS64 in C
I am trying to run a file compiled in c and I get the following error message: "error while loading Shared Libraries: libpq.so. 5: Wrong ELF class: ELFCLAS64" I did a search and identified that this…
-
0
votes1
answer92
views"Could not find driver" when setting the application’s root page
When rotating the command php -S localhost:8080 -t public The above error is triggered when I try to make a connection with postgres. Other applications can access normally when accessed through the…
-
0
votes2
answers177
viewspass query value php postgresql to modal bootstrap
I want to pass the value of php/postgresql query to modal but I’m not getting it. I have a dynamic table that lists the results. In one of these columns I want to include the modal button (popup)…
-
0
votes1
answer212
viewsjsonb: how to fetch the value of the same key of all objects in an array?
I have a type column jsonb that stores objects in an array. I can get the key template of all index objects 0 thus: psql=# select data->'components'->0->'template' as template from page;…
-
0
votes1
answer508
viewsConnection php to Postgresql database
Problem when connecting to Postgresql database using PHP. When I run the function pg_conect(), the following error occurs Fatal error: Call to undefined function pg_connect() already added the…
-
0
votes1
answer452
viewsForce Postgresql to use an index, how?
There is a way to force Postgresql to use a specific index? I have two equal tables (different servers, of course), with the same indices created in each one, however, in one server the index is…
-
0
votes2
answers2415
viewsSQL query that compares two tables and returns values
Work with a database using with DBMS Postgresql, where I need to compare tables, example: table_janeiro and table_February. I need to perform two consultations... first You must return the values…
-
0
votes1
answer34
viewsSelect number of returned lines
Is it possible to select the number of rows returned in a select? For example: In that case it would have to be returned 12.…
postgresqlasked 6 years, 8 months ago R.Santos 2,251 -
0
votes1
answer53
viewsError running Postgresql admin:
I downloaded Postgre 9.6 and installed everything "default". But when running the Postgre graphical interface, "pgadmin4" gives the following error: "The application server could not be contacted".…
postgresqlasked 6 years, 8 months ago Lucas Pletsch 787 -
0
votes0
answers186
viewsSQL script to adjust decimal point of a column - Postgresql
I have a table in Postgresql that has the field IdProduto and Quantidade. The values in the column Quantidade were recorded to the wrong decimal places. Ex: It was recorded 9000,000 when it should…
-
0
votes1
answer312
viewsConnections Pool opens connections but does not close after!
I am facing some problems with my postgresql connection pool with java, in which it is called by my Daos methods quietly, but does not close after the method runs, And that really gets in the way of…
-
0
votes0
answers32
viewsReturn a query by taking data from three tables
I need the result of three tables in a query to generate a google chart. table 1: // This will be the One column SELECT SUBSTRING(dt_vencimento,1,7) as anomes, SUM(vl_valor) as valor_total FROM…
-
0
votes1
answer786
viewswrite images to postgresql database with php
I intend to upload images through the browser to a postgresql database using php. I tested with lo_import but it gives me an error indicating that it has to be via superuser on the server side. Any…
-
0
votes1
answer1582
viewsHow popular in database to perform tests?
I am needing to popular this bank to perform consultation tests for didactic imprint. I already have about 5 students, 2 teachers, but the problem is to popular the exercises manually. There is some…
-
0
votes0
answers30
viewsCreate GRANT on condition
I have a DRIVER table (columns: name, cnh, address, dots_wallet) and a GRANT analyst. The analyst can only access data from drivers who have more than 0 points in the wallet. Grant select on…
-
0
votes1
answer489
viewsHow to Save the Date Field of a Java SE Application in Postgresql
I need to save these two dates (ALLOCATION DATE and RETURN DATE) from an allocation, where I have the following Allocation Table: CREATE TABLE public.aloca ( alocod serial NOT NULL, alodtdevolucao…
-
0
votes1
answer147
viewsdownload/print file recorded in postgresql database with php
I uploaded a file to the postgresql database with the OID column type. With the code below I can view/open the file in the browser, but I intend to download and/or print that same file on the…
-
0
votes1
answer614
viewsSave image in database and give Restore in database with Postgresql
What is the best way to save image in Postgresql database? Currently I have an OID to save, I can use normally, both to save and to recover, but when I give Restore in my database, the following…
-
0
votes2
answers994
viewsSubquery in Java HQL
Hello, I am in a project that uses geolocation and I am doing a feature to list the stores closer to the location chosen by the user. I am using the Postgresql database and I made this query to…
-
0
votes1
answer81
viewsFunction Postgresql
I need to create a Function() in my bank PostgreSQL so that whenever there is a movement of INSERT or UPDATE this function is activated in a given table through a TRIGGER so that in my log table are…
-
0
votes1
answer812
viewsError in wildfly postgres configuration
I performed the postgresql configuration: C: wildfly-10.1.0.Final modules system layers base with postgresql main I added the files: module.xml postgresql-9.4.1208.jre7. jar OBS: The bank has…
-
0
votes1
answer43
viewsPostgresql: Catch amount of errors and hits
I need a query to get amount of errors and hits from this table.…
-
0
votes1
answer59
viewsSee how many Products were sold in 2017
I’m having difficulty making this query using BETWEEN, this is the model.…
-
0
votes1
answer505
viewsProblem Inserting Bytea in postgresql
I did this update to update a column in my company table, my column in the database is like bytea and I’m saving an image as byte[] ... in my company class, I have the variable Photo that is of the…
-
0
votes0
answers90
viewsGroup weekend and holiday values for next business day
Guys, I have the following problem, I need to group all balance amounts that fall on Saturday, Sunday or holiday for the next working day. I have a table invoices with the values of saldo and the…
-
0
votes1
answer24
viewsError syntax in query with Postgresql JSP sort
I made a select in the database in which will make a query according to name, and order it but when executing select happened the following error. public List<Motoristas>…
-
0
votes1
answer472
viewsConsultation to calculate the number of female and male students
In this consultation I would use the GROUP BY? That and the model…
-
0
votes0
answers33
viewsProblem with postgresql server version Mismatch
I am trying to restore a base, small , I perform the backup on my machine in version 9.6 , but, alleges error when trying to create the backup via pgadmin III, executed through a bat : pg_dump.exe…
-
0
votes1
answer45
viewsHow to shrink a large query - Postgresql
In Visual Studio, we have the possibility to shrink a large code, IE, visually decrease the size, as a way to facilitate reading, example: #region Seu código aqui... #endregion I would like to do…
-
0
votes0
answers287
viewsModeling Banks Financial Institution
I am starting a personal project for my learning, an application simulating a financial institution system, first using the following products: current account, credit agreement (loans). I came…
-
0
votes0
answers139
viewsCondition check to launch Trigger
I have this table: CREATE TABLE public.tbtramite ( idtramite integer NOT NULL DEFAULT nextval('tbtramite_idtramite_seq'::regclass), dsdescricao character varying(255), dttramite timestamp without…
postgresqlasked 7 years, 2 months ago Mateus 977 -
0
votes1
answer65
viewsError connecting BD postgres with PHP
I have Postgres 9.3 installed on a Windows server 2012. I need to collect BD information for a website. I’ve already set up the network router forwarding port 5432. On pg_hba I changed the line:…
-
0
votes1
answer698
viewsError inserting data in postgree: column "test" does not exist
In a crud basic, I’m getting the following Node error: "Erro na inserção dos dados { error: column "teste" does not exist at Connection.parseE (C:\Users\SUPORTE\Desktop\NodeFINAL\appFinal\app1\nod…
-
0
votes2
answers73
viewsValidate only 1 and 2 in an sql table in the relational and logical model?
Good morning, as I do to validate values using relational and logical relationships , where the employee can only enter values below? 1: Disponível 2: Emprestado…
postgresqlasked 6 years, 5 months ago Futebol Arts Variados 43 -
0
votes1
answer295
viewsProblems connecting Postgres with java
Well, I’m having a problem connecting my java application to my database (I’m using pgAdmin4 which is basically postgres). Java code: public class ConnectionFactory { private static final String…
-
0
votes0
answers624
viewsError connecting a postegresql bank to Laravel
I’m having a problem using Laravel with postgresql on Linux, when trying to connect with the database it says it does not find the postgresql driver, I have already enabled postgresql in php.ini so:…
-
0
votes1
answer1024
viewsScript for postgres bank
I created this script to clear the bank table and reset id's. It works, but not in the right way It runs and authenticates on psql. but instead of running the commands sql it only opens the psql. If…
-
0
votes1
answer69
viewsPostgresql/Visualstudio database modeling
Hello. I have this form: How much the modeling of the bank there in the part of "products" I intend to load all products(name, quantity available, unit value) and when the person selects some and…
-
0
votes4
answers1289
viewsHow to write a Datetimepicker to the database
Hello, I have a form with the Datetimepicker - Short (only the date). And in the database I put DataEntrada DATE My problem is, I created an insertion method but I don’t know how to pass the…
-
0
votes1
answer291
viewsCreate an Oracle Agent/Job for Postgresql
I wonder if it is possible to create an agent/job in Oracle to query the data of a given table and insert the data from this table to another table that is in Postgresql. Or if I can through…
-
0
votes1
answer40
viewsGenerate file D-1
How to perform the select of data in format D-1 (current day - 1), what would be in VBA a AGORA() - 1, how it would be in postgresql? I have the following query and would like to take yesterday to…
-
0
votes2
answers493
viewsHow to do if in sql - Postgres
Need to do an if in the example postgres. SELECT log."data" AS log_data, log."tipomovimento" AS log_tipomovimento, log."nomefornecedor" AS log_nomefornecedor, log."nomeproduto" AS log_nomeproduto…
-
0
votes2
answers77
viewsError trying to save combobox and Masktextbox
I have a form with two fields: 1 Combobox I put the type of people (Physics or Legal); 1 Masktextbox with CPF; At first I don’t know what’s better if I keep the value of Index of the combobox or its…
-
0
votes1
answer506
viewsPassword when executing postgresql command
Good morning, I am trying to create a database in postgresql via terminal in windows. But ask me for a password every time I give the command. I tried to use the password of the user postgres but…
-
0
votes1
answer963
viewsEntering data into the database gives the error "duplicate key value violates uniqueness restriction"
I tried to enter the data, but it gives the error duplicate key value violates uniqueness restriction. I’ve already put all the primary and secondary keys. MSG of error:…
postgresqlasked 7 years, 1 month ago Katielen Castro 11