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
votes2
answers117
viewsReturn records that total desired value
I have a table in this format, with more N values and N suppliers, approximately 100 thousand records, and I need to do through a query or a plpgsql function a way to get all the release numbers num…
-
2
votes0
answers106
viewsCopy data from one BD to another whenever you have a new record
I need to copy the data from a BD-1 PGSQL to another BD-2 PGSQL whenever I have a new record. I was trying to give a SELECT inside the INSERT but is failing with the connection, I already checked…
-
2
votes1
answer105
viewsHow can I compare the data in the same column?
"Create a function (named fn_bo_varios_states) that takes as parameter the code (INTEGER) of a victim and return (TRUE or FALSE) if she has already registered reports of occurrence in more than one…
-
2
votes0
answers142
viewsPostgresql - autovacuum in small table
What would be a suitable configuration for autovacuum act in this table ? We have a "sequence" table, does what the sequence postgres should do, but perhaps by using other banks the development…
-
2
votes1
answer55
viewsMultiple Fault Handling in Angular
I am developing a code and in the same I build some areas of influence for given locations (with coordinates and radius of distance or walking time from the coordinate), so when I complete its…
javascript angularjs web-service postgresql web-applicationasked 7 years, 3 months ago Nicholas Maestrello Agiz 69 -
2
votes1
answer242
viewsError entering data into database
I am making a system in java with postgresql database for client registration, any help is welcome to solve my problem. org.postgresql.util.psqlexception: ERROR: syntax error at or near ","…
-
2
votes1
answer341
viewsHow to call a database Function from the code
would like a help, i have the following Function that is in the bank postgres CREATE OR REPLACE FUNCTION public.get_id(campo character varying) RETURNS integer AS $BODY$ DECLARE _id integer; BEGIN…
-
2
votes1
answer732
viewsCreate a precedent in Postgresql
I have created a database in Equipment Allocation Postgresql where one or many Equipments can be Allocated by one or many Sectors. That is, I have 3 tables in this relation: One is the Sector Table…
-
2
votes2
answers1701
viewsLeft Join with + equivalent in POSTGRES
In the oracle I can give a left Join with using (+) ex: select from tabela1 A,tabela2 B where A.id = B.id(+); In the above example was made a LEFT JOIN because I want to return all the data from…
-
2
votes2
answers1455
viewsDatabase/slow server
I’m starting in the database area and I notice a great slowness in some banks I use in virtual servers. In my case I access a windows that has a postgres and with an average frequency my scripts are…
-
2
votes1
answer359
viewsnode extraction via postgresql
It is possible via commands in Postgres to process vector data. I have a table with data that represent the displacement of objects and need to extract final and initial Vertice. This is possible…
-
2
votes2
answers343
viewsIs there any way to know which tables have Bytea type fields in a Postgresql database?
I have a base with 500MB I consider small, but this slow to open some tables, checking are tables that have Bytea field, the other programmer saved images in the database, but it is impossible to…
postgresqlasked 6 years, 6 months ago Marcelo 1,768 -
2
votes2
answers876
viewsQuery SQL to select student and student name
I have this simple relational model, and I need a query that selects the student and the student’s name.…
-
2
votes1
answer1063
viewsDoubt error "Unable to build Hibernate Sessionfactory" Java
I received the sources and after doing the server settings, database etc, I have this problem in the compilation. I would appreciate it if someone could indicate a direction in the solution.…
-
2
votes1
answer30
viewsQuery to catch a student’s mistakes and successes
I would like a query to catch mistakes and hits from a particular student of the following table below:…
-
2
votes0
answers25
viewsDescription of the EF Core Field
Good Morning Assuming I have a 'Description' field in the database, as I do via Fluent API for in return come "Description" (so it can be written correctly on screen )
-
2
votes2
answers229
viewsDynamic SQL result sorting
First good afternoon, I work specifically with Java in the Back-end using Webservices Rest and Postgresql, after some professional enhancements I was instructed to pass ordering and pagination of my…
-
2
votes3
answers2371
viewsDownload all columns of all tables containing a text
I would like to find out which are all columns of tables in a database in a way that it is possible to search a word in these columns. Let’s say I have a database I don’t know the structure of but I…
-
2
votes0
answers39
viewsCount records that precede the selected one in the sql server, mysql query
I have a question: How do I know how many records you have before a selected value. For example: Select * from cidades where nome= 'SAO PAULO' ORDER BY nome Assuming that the cities table has 500…
-
2
votes4
answers90
viewsIs there a difference in these two querys?
Is there any difference in these two querys? What is the difference of using parentheses in and? SELECT * FROM produto WHERE grupo = 'bebidas' AND preco < 10 OR estoque <= 100 ORDER BY estoque…
-
2
votes4
answers19922
viewsLimit the number of SQL query lines
I have the following Query SELECT estado, num_ocorrencia FROM bra_ocorrencias WHERE nome like 'João' ORDER BY num_ocorrencia DESC It returns me all the states with the most relevant occurrences…
-
2
votes1
answer401
viewsQuery to sum query total
I have a Query to select a user list with rates I have to make the sum of these debits. SQL /* * PAGAMENTO */ SELECT pe.name as nomepessoa, py.created_at as datapagamento, py.amount_paid as…
-
2
votes2
answers710
viewsHelp with Join in two different selects
I have two select commands (a bit complex). First code: select A.no_cidadao NOME, F.no_equipe UNIDADE from tb_cds_cidadao_resposta E, tb_cds_cad_individual A, tb_cds_prof as G, tb_pessoa_fisica as…
-
2
votes2
answers3090
viewsWorking with application.properties file
See my application.. properties file: spring.jpa.database=POSTGRESQL spring.datasource.platform=postgres spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto=create-drop…
-
2
votes0
answers140
viewsHow to create tables in Postgre with fields not null?
good morning gentlemen, I made my attempt to create my Postgre table this way: CREATE TABLE categoria ( codigo BIGSERIAL, nome VARCHAR(50) NOT NULL, PRIMARY KEY(codigo) ); Despite the countryside…
-
2
votes2
answers2434
viewsIn terms of performance, "Character Varying" or "text" in Postgresql?
Before posting this question I scoured the internet to know the differences and performance of each type and I came to the conclusion that I should discuss a little more on this subject here with…
-
2
votes1
answer41
viewsRails - Relationship BD
I have a table user, where I have a mandatory field cidade, and I have a table contatos (that is belongs_to: user), but the form does not have the field cidade which is mandatory to user. How do I…
-
2
votes3
answers5576
viewsIncorrect daylight saving time on Postgresql
With the change of date of the start of daylight saving time this year, postgresql database are experiencing problems (as well as several other systems), going on to inform the timezone with dls…
-
2
votes1
answer1115
viewsHow to create COLLATION for Brazilian Portuguese
In the documentation says to create the collation thus: CREATE COLLATION french (LOCALE = 'fr_FR.utf8'); This example is for France. How it would be for Brazilian Portuguese?…
-
2
votes1
answer56
viewsPostgresql build error
Would anyone know if there is an error in the query below: select name, cast(Extract(day from payday) as int) as 'day' from loan; I cannot find the reason for a build error in the URI.…
-
2
votes1
answer58
viewsPostgresql build error - Error
I’m trying to run this query in postgresql but it gives compilation error: select can.name as 'name', ( ( (sco.Math 2) + ( sco.specific1 3 ) + ( sco.project_plan * 5 ) /10 ) as "avg" from candidate…
-
2
votes3
answers5148
viewsReturn BD data using List/Arraylist - Java
I have a problem, I set up a dynamic table in Postgresql and I need to print the lines of it, performing a method in Java, whose beginning is already pre-set. That would be with a List simple with…
-
2
votes1
answer43
viewsSelect only the days of a Timestamp
I need to select only the days of a date subtraction, and if possible convert this number to Integer, is this possible? SELECT (select count(numeroserie) as porcentagemTotal from…
postgresqlasked 6 years, 9 months ago R.Santos 2,251 -
2
votes1
answer721
viewsError installing psycopg2 in a pypy virtualenv environment
I installed the shape sequinte pypy: wget https://bitbucket.org/pypy/pypy/downloads/pypy3-v5.10.1-linux64.tar.bz2 tar xf pypy3-v5.10.1-linux64.tar.bz2 virtualenv -p ~/pypy3-v5.10.1-linux64/bin/pypy…
-
2
votes0
answers207
viewsRelationship between three tables - Postgresql
need to make a relationship between three tables in the database in Java, created the two entities and the methods of the two entities, now need to insert a relationship table that has only two…
-
2
votes1
answer308
viewsSQL - Transform different values of a Column into multiple columns with Count in each of them
My question is how to separate different values of a column into several columns and give a Count in each item according to the name in postgres, follows example below How are you: --TIPO…
-
2
votes1
answer93
viewsCalculating Easter Date in Postgresql
I was installing some functions in postgresql with mysqlcompact and I came up with the idea of developing a function that would calculate the day of Easter so I did a search, but how I convert this…
postgresqlasked 6 years, 8 months ago dark777 611 -
2
votes1
answer251
viewsSub select with COUNT and SUM
I have the following query: SELECT s1.suprimento, e1.numeroserie, s1.capacidade, e1.numeronotafiscal, e1.valorunitario, e1.datanotafiscal FROM public.estoque e1, public.suprimento s1,…
-
2
votes1
answer453
viewsDelete Rows in several tables dynamically in Postgres
I need to delete to clean the database automatically in tables that are within different schemas, "public" and "cine"; I have the following query that returns me SELECT concat('"',table_schema,'"',…
-
2
votes3
answers992
viewsBring the latest record with conditional - Postgresql
I have a table with product information (product code, customer code, purchase date, purchase value, etc.) and I need to pull the following information: 1- All customers that last purchase was a…
-
2
votes1
answer57
viewssend login information to the bank for comparison
I am developing a system with login and password, using Windows. The registration part was even easy: public function salvar(){ $usu_email = Request()->input('usu_email'); $usu_senha =…
-
2
votes1
answer250
viewsHow to convert this character to Postgresql?
I am using Delphixe and Postgresql, it happens that I need to insert some characters in the database that are not accepted in LATIN1. My base is UTF-8, but as the system has been transported since…
-
2
votes0
answers35
viewspgsql authentication via LDAP
Machine login and password authentications are allocated to a server ldap, however, I would like those same passwords and logins to be able to access a server that is on pgsql. I did the following…
-
2
votes1
answer473
viewsrecord time in Postgresql database
In the application I inform the start and end time of the activity, and save this information in the bank. Segue Query: $status = $_GET['status']; $intervalo = $_GET['intervalo']; $dataini =…
-
2
votes1
answer690
viewsPostgresql autoincrement skips 1 value when Insert is done by a function
I have the following function in Postgresql: CREATE OR REPLACE FUNCTION ve.geraHistorico() RETURNS VOID AS $$ DECLARE i INTEGER := 1; id INTEGER; dataCad TEXT; dataFec TEXT; qtd INTEGER := (SELECT…
-
2
votes1
answer217
viewsSQL JOIN multiple tables
I have 4 tables that I need to extract the results, but I always get duplicate records, someone can help? tabclientes: codcli nome 1 A 2 B 3 C tabrepre: codrepre nome 1 AA 2 AB 3 AC tabvendedor:…
-
2
votes2
answers2513
viewsSQL - How to Get Last Day of the Previous Month Dynamically In This Situation
Good, how do I make to obtain the last day of the previous month dynamically (associated with the current date); I have a spine which is associated with the date on Milliseconds 'Wo.CREATEDTIME' -…
-
2
votes1
answer864
viewsSave Request Spring Boot
I’m a beginner at Spring Boot and I need a little help. I want to save an incoming and outgoing request by generating the automated id and saving the date and time, using Docker and Postgres (I…
-
2
votes1
answer664
viewsProblem in a simple Inner Join Update
I’m running a simple update on my base, however set which I am giving, is being replicated for all rows of the table. Follow the script executed: update reference_vendor set internalid =…
-
2
votes2
answers271
viewsDapper requires writing SQL code, why?
I’m looking at the following link that uses Dapper: Getting Started With Postgresql Using Dapper In . NET Core and my question is, when I do Java I don’t need to write SQL code as this example here:…