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
-
1
votes1
answer96
viewsRandom character insert - Postgresql
I have a Function that makes an Insert when a certain action occurs, I’m trying to insert together random letters but I’m not finding anything related to this, It is possible to do this in…
-
1
votes3
answers1525
viewsHow to create an incremental Update sql command
I have a table Estoque where today there are already numerous rows of records already registered, how can I do an Incremental Update to fill a column that I added the table now? Produto | N_Serie |…
-
1
votes0
answers148
viewsJava/Postgresql - Function does not return values
I am creating a webservice where I will return the values of my postgresql table. However, when I run this function, a blank screen appears as if there were no data to be returned. I purposely…
-
1
votes1
answer685
viewsSpecial character error in Java
I’m having a problem here and I haven’t found anything that would solve on the internet, if you could help me, I would be extremely grateful. Well, come on, I have a java web application that uses…
java postgresql spring spring-boot character-encodingasked 7 years, 3 months ago GiovaniOliveira 41 -
1
votes1
answer61
viewsSave formula postgresql
I have the following query UPDATE teste SET equacao = 'X*254/1024+15.2', zerar = False, MinValid = 0.00 WHERE id = 1 RETURNING * It runs normally, but when I get to the database the plus signal +…
postgresqlasked 6 years, 9 months ago Christian Beregula 1,512 -
1
votes1
answer3125
viewsRestore from only one table - Postgresql
How can I re-store only one table from one bank to another? I created the table backup from the following command in CMD: pg_dump -f C:\Backup\Backup_table.backup -t public.lotesretornosuprimento -d…
postgresqlasked 6 years, 9 months ago R.Santos 2,251 -
1
votes2
answers2140
viewsHow to add a "Constraint Unique" to a column without deleting the table or column
This is the example table create table usuario( id serial primary key not null, nome varchar(100), email varchar(100), login varchar(100), senha varchar(100), tipo varchar(50), status varchar(30) )…
-
1
votes3
answers789
viewsProblem sorting sql with orderby Date in postgresql
I have the following query that results in the union of the total sum of an account and the installments select sum(total) as total, datavencimento from ( select sum (con_valoraserpago) as total,…
-
1
votes1
answer8428
viewsjava.sql.Sqlfeaturenotsupportedexception error: org.postgresql.jdbc.PgConnection.createClob() method not yet implemented
I created my Spring Boot project, I did not create any Java class and is already giving error, my problem is to connect the project with the Postgresql database. see my pom.xml file <?xml…
-
1
votes3
answers1674
viewsWhat is the best way to store videos, audios, images, documents in a bank?
I want to create a repository system where people can store videos, audios, pdfs, images etc. I will probably use PGSQL and want to know what is the best strategy for storing this data that can be…
-
1
votes1
answer318
viewsHow to pick up the percentage of Postgre database storage space via EF Core in Asp.net Core
I need to create in my application a feature that checks in the database (PostGreSQL) the percentage of storage space used to be shown in a graph. I have a generic repository, and I thought I’d…
asp.net entity-framework postgresql asp.net-mvc-5 postgresql-administrationasked 6 years, 8 months ago Master JR 1,853 -
1
votes1
answer1231
viewsHow to create this view in postgres?
CREATE VIEW grafico AS SELECT AVG(realizacao) , AVG(estima), AVG(fisiologica),AVG(seguranca),AVG(social) FROM necessidade; I am trying to create a view that brings the average of five columns of the…
-
1
votes0
answers51
viewsHelp tool in Postgresql . conf configuration
someone knows some tool that assists in adjusting the parameters of the postgresql.conf file. I’ve used the PGTUNE and of Pgconfig, but they indicate nothing of the parameters: cpu_tuple_cost…
-
1
votes1
answer162
viewsSave user location
I am trying to save the user’s location in a database, to subsequently generate reports on users by country, state and region. Initially I downloaded bases that contained the name of all the cities…
-
1
votes0
answers52
viewsAre multiple JDBC connections "thread-safe"?
I am creating a very simple java and postgresql project of clients and contacts between clients. Exists the table clientes with id and name, and the table contatos with id1 and id2 which refer to…
-
1
votes1
answer159
viewsProblem saving Combobox data to Postgresql
First this is the bank code I’m using: CREATE TABLE perguntas ( cod_pergunta SERIAL PRIMARY KEY NOT NULL, pergunta VARCHAR(500), opcao_um VARCHAR(500), opcao_dois VARCHAR(500), opcao_tres…
-
1
votes1
answer808
viewsdisplay jpg image saved to postgresql database (oid) for html
I recorded an image in the postgresql database with the OID type and now I intend to display this image on an html page with the tag . I verified that through the lo_export I can send to a folder…
-
1
votes2
answers1079
viewsHow to disable Trigger for all tables in Postgresql?
How to disable Trigger from all my tables in postgresql?
-
1
votes0
answers120
viewsWhy this error in Postgresql if I am not using SSL?
Why am I getting this mistake: SSL SYSCALL error: EOF Detected Connection is via local network via Delphi Application -> Posgtresql I use the ZEOS component for connection…
-
1
votes1
answer711
viewsConnect to sql database a postgres database
Scenario: I have the postgres database A, but I need to connect to the database from sql server 2017. How can I do this?
-
1
votes1
answer152
viewsConnect MS SQL in PGADMIN
Hello, good afternoon! I need to know if there is any tool, script or anything else from where I can have the following scenario: I have a MS SQL database but need to manipulate it through pgAdmin…
-
1
votes1
answer542
viewsHow to popular a postgres table with JSON?
I would like to popular my tables with Json. But I’m not getting it. Does anyone have any solution? Follows JSON: https://gist.github.com/letanure/3012978…
-
1
votes1
answer101
viewsHow to sort the results more similar to the parameter passed?
I have a table in my system that stores all airports and in a select autocomplete i have this list where I can search. The problem is that I can search for "nome", "cidade", "país" and "IATA" and…
-
1
votes1
answer1473
viewsError importing Postgre bank
I have a bank to import, it’s native to Postgresql and is with extension .sql, I’m trying to care in the PgAdmin4 but I can’t do it at all. There’s a picture of the error.…
-
1
votes1
answer1282
viewsSee the best-selling product
I’m having trouble joining two tables and using some aggregation function, I’ve tried it like this: SELECT nome FROM produto INNER JOIN vendaproduto SUM(quantidade) ON produto.idproduto =…
-
1
votes2
answers521
viewsConnecting Elephantsql with java
I’m trying to make a connection with the Elephantsql (postgres) through java. With the same code I was able to connect to the local postgres (just changing the url, user, password). I’m trying to do…
-
1
votes1
answer219
viewstenant application for multiple users
Well my doubt and while the approach of creating a database in the following scenarios Multiple Database, a user-created database Multiple Schemas, well would have only a single database, but each…
-
1
votes1
answer999
viewsLEFT OUTER JOIN
I have a table in Postgresql. I would like to count two columns where one has more record than the other. If I use LEFT OUTER JOIN I think it will work, however, I’m not succeeding with the…
-
1
votes1
answer157
viewsPostgre - Field Id (Integer) of a table can go from 1 to how much?
I have a table in Postgre whose Id field is Integer type and primary key. As records are saved, the numbering goes from 1 to how much? I’m used to the Dataflex database, where table records (by…
-
1
votes3
answers268
viewsSelect postgres between two values
I am developing a system and I need to perform a select to fetch the % rate a customer will have. First I check what % of this customer’s cheque refund and look in another table what the predefined…
-
1
votes1
answer310
viewsExport Text field to Bytea in Postgresql
I could make an application to export the contents of a Text field to Bytea without problems, but since there are thousands of records I believe that if I do via SQL will be faster. If that is…
-
1
votes2
answers33
viewsHow to email each new record?
I’m using Postgres 9.6 in a project and one of the requirements is that the system send an email to each new client. 1 - Trigger is a good way to do? 2 - When it comes to performance. What would be…
postgresqlasked 6 years, 4 months ago Fabricio 782 -
1
votes0
answers90
viewsRemote connection with Postgresql only works after PING
I have a JAVA application running on one server and the database running on another. Both servers are connected and on the same network, postgresql is enabled to receive external connections. But…
-
1
votes3
answers6281
viewsFile . bat to generate backup and Restore in Postgresql
I am creating . bat files to backup and restore a database in Postgresql using windows 10 and pg 9.4 I perform the following command to perform the backup set PGUSER=postgres set…
-
1
votes1
answer186
viewsError while trying to perform postgresql database backup
I am trying to perform a backup of a database in Postgresql, however I am getting the following error: erro ao ler objeto grande 118287: ERROR: permission denied for large object 118287 I searched…
-
1
votes1
answer849
viewsError executing query in Postgresql
After executing this query: SELECT p.name as nomerecebe, r.created_at as datarecebimento, r.original_amount as valorboleto, rs.name as statusr, SUM(r.original_amount) as total FROM people as p,…
-
1
votes1
answer82
viewsSQL: Avoid repeating line and adding values
I have this select: select DISTINCT (clients.name) as nomeempresa, payments.amount_paid as pagamento, receipts.original_amount as recebimento FROM payments, receipts, receipt_status, payment_status,…
-
1
votes2
answers47
viewsHow to dynamically get specific day in a query
I would like to get the last day of the previous month in a dynamic way. I don’t know how to put the wo.createdtime <= Moth(current_date) something of the kind and this is in milliseconds,…
-
1
votes1
answer97
viewsSQL Alphabetical sorting with html code
I have a table that contains the field titulo. I have a query and want to sort alphabetically by it, however, some fields are with HTML code, I will give examples: Goat Slaughter and Meat Processing…
-
1
votes1
answer34
viewsincrement lines based on a postgresql record
I have a query that returns the amount and initial value and I want to transform this query into several lines according to the quantity. Example: Consultation: select 3 as numero, 10001 as…
-
1
votes0
answers73
viewsRestart Postgres on Windows
I am trying to create a database in Postgres, but is giving the following message ERROR: cannot execute CREATE DATABASE in a read-only transaction I’ve reinstalled and nothing. I’ve already put off…
postgresqlasked 6 years, 3 months ago adventistaam 3,354 -
1
votes0
answers135
viewsIs it possible to encrypt the connection password to the database that is inside a Java application?
I have an application in Java and using the Postgresql database. To connect to the database I use this method: public static Connection getConnection() throws Exception { try {…
-
1
votes1
answer515
viewsSelect com when e case
I have the following select query: select F.nu_ine INE, to_char(D.dt_ficha, 'YYYYMM') as CMP, I.co_cbo_2002 CBO, CASE WHEN (B.tp_atend = 1 or B.tp_atend = 2 or B.tp_atend = 5) and I.co_cbo_2002 !=…
-
1
votes2
answers159
viewsHow to separate a letter from a Character in SQL?
I have a variable of type Character Varying(17) and I need to separate one of the characters, for example the third letter, and use it to filter.For example: SELECT * FROM fnord WHERE…
-
1
votes1
answer1926
viewsHow to create a Primary Key Constraint named in Postgres?
I am proceeding this way to create a table without primary key initially. Then I add a field id serial type and try to create the Constraint to the Primary Key (PK): create table macaco( nome…
-
1
votes1
answer782
viewsHow to know that the attribute is not null in the Postgresql database?
I am developing a Java system with Spring Boot and created the table as not null as you can see: CREATE TABLE categoria ( codigo BIGSERIAL, nome VARCHAR(50) NOT NULL, PRIMARY KEY(codigo) ); The…
postgresqlasked 7 years ago wladyband 4,694 -
1
votes2
answers76
viewsProblem in consultation with Join
I’m having a little problem with the consultation to generate a report. I made a JOIN of the orders table (that will take the report) with the table of customers and products. Until then everything…
-
1
votes1
answer98
viewsConsult the names of the pilots sponsored by a Team
I want to consult pilots sponsored by the 'A' team' I’m doing like this: SELECT piloto.nome AS NomePiloto FROM equipe INNER JOIN piloto ON equipe.idequipe = piloto.idequipe INNER JOIN patrocinador…
-
1
votes1
answer143
viewsHow to make a linear regression in postgresql?
I wish to make a simple linear regression directly in the database. I noticed that postgresql already has some statistical functions, which seems to me to be for this purpose (regr_slope(Y, X),…
-
1
votes1
answer186
viewsUpdate an attribute according to two other tables
Table Company CREATE TABLE empresa ( cnpj char(18) PRIMARY KEY, nome varchar(60) NOT NULL UNIQUE, receita float NOT NULL, pais_sede varchar(26) NOT NULL ); Target table CREATE TABLE destino( cidade…