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
answer58
viewsHow to count the amount of distinct occurrences in a BD and return
I have 3 tables in a library database. One is the member table, with the age of that member and one PRIMARY KEY. The second table, book, has a PRIMARY KEY isbn and the rest of the attributes authors…
-
1
votes2
answers55
viewsPostgresql change an element of a JSON column
Hello, I’m trying to change a JSON column, but I want to change only one element, in this case, the "url". There are some urls that have the symbols ' ' and '$' at the beginning and end, as below:…
-
1
votes1
answer31
viewsIs it bad practice not to specify NOT NULL in a SERIAL field? Postgresql
Hello, I was doing some activities and I differed from some colleagues. The end result was the same, but I was wondering if it is bad practice to use the following code CREATE TABLE Estudio ( codEst…
postgresqlasked 3 years, 9 months ago Aleczk 97 -
1
votes1
answer57
viewsPostgresql: How to select a field based on the maximum value of another field?
I have a table with the following configuration: create table baixas_do_requerimento as codigo_requerimento text, tipo_baixa text, data_baixa timestamp Each código_requerimento can repeat numerous…
-
1
votes0
answers26
viewsEncoding error when running script
well, I’m trying to run the script this way: psql -U [usuario] -d [banco] -f [script] and in the cmd appears like this: DROP TABLE CREATE TABLE COMMENT COMMENT psql:pais.sql:282: ERROR: character…
-
1
votes0
answers43
viewsProblem with findOne verification
I am using typeorm and postgres. In my use case I have a execute method: async execute({ name, email, password }: ICreateUserDTO): Promise<void> { const userExists = await…
-
0
votes1
answer129
viewsQuerydsl with Abstract class
I need to do a query that returns an Abstract object. In this case when my code arrives in ". list()" it launches an Exception, on the other hand, if I use the ". list" but returning an attribute of…
-
0
votes1
answer109
viewsRestore a Postgis dump 2
I am trying to restore a dump from a postgresql database with postgis template. When I try to restore the dump by terminal, I have a number of errors. Command used terminal: psql archeology -U…
-
0
votes1
answer400
viewsOverwrite Primary Hibernate Key Generator
I would like to know if you can overwrite the generator of a primary key in Hibernate, in my case I make a superior class where the id, and the rest extend from her. In my case this subclass, which…
-
0
votes1
answer99
viewsDeploy with Capistrano
I have to run my Rails app on one machine and DBMS (in this case Postgresql) on another server. I set up the database.yml as follows: production: <<: *default database: nomedobanco username:…
-
0
votes1
answer1873
viewsPostgresq-9.2 failed connection to Unix Domain Socket
I configured the postgresql-9.2 database in my Ubuntu 14.04 and it shows the following error when communicating with the database Is the server running locally and Accepting Connections on Unix…
postgresqlasked 10 years, 5 months ago ygorbr 77 -
0
votes2
answers558
viewsGroup plots showing the value of the first and last plot
I have a table of plots with the following fields (among others): inscricao (Customer Registration), nrparcela (Plot number), dt_vencimento (Due Date) and vlrparcela (Value of the Plot). If the…
postgresqlasked 10 years, 6 months ago Caesar 64 -
0
votes3
answers2325
viewsOrder By - Leave specific record for first
Store_Name | Sales | Date America | 1500 | 05-Jan-1999 Boston | 700 | 08-Jan-1999 Canada | 300 | 08-Jan-1999 Dinamarca | 250 | 07-Jan-1999 I have this table, I’d like to sort in a way where Boston…
-
0
votes1
answer911
viewsPHP + POSTGRESQL (Begin, Commit, Rollback)
In my application I have a certain process to perform test. This involves database with multi tables. I wonder if it is possible to start a BEGIN; make all manual development, and in case of error,…
-
0
votes1
answer2756
viewsAndroid connect on Postgres
I have an application, and I want to use the postgres database, that database is on a server, and I can access that server, as I do the connection. I don’t know if I explained it right, but I think…
-
0
votes1
answer108
viewsRails 4 select Uniq
I have the table Items: id enrollment_id turma_id 11 2 2 12 2 3 13 2 2 14 2 2 15 2 3 I want my result to be this: id enrollment_id turma_id 11 2 2 12 2 3 That is I want all the items, but that does…
-
0
votes1
answer101
viewsHow do I create DESTROY link with Slim?
I’m starting with Rails, and I’m not able to link to delete a "post" from the site. Follows how the links are new and edit p.btn = link_to "Editar informações", edit_property_path(@property) if…
-
0
votes1
answer586
viewsHow to add postgres library to eclipse/android
I’m making an android app, which I will connect directly to a postgres bank on a server. However, I don’t know how to add the postgres jar, if I add it in Java Build Path in the project’s properties…
-
0
votes1
answer1473
viewsSingle column calculation in Postgresql
How to make a calculation (example: subtraction) of summed values of the same column in Postgresql? Example of query: DROP TABLE if exists saldo; CREATE TEMPORARY TABLE saldo AS select a.usuario…
postgresqlasked 9 years, 12 months ago Jorge Kania 192 -
0
votes1
answer1385
viewsError: table name specified more than Once
I created a column included in the app table, it works to record the purchase date of the app and I will have to update the old records with the user creation date. I made a query to solve the…
-
0
votes3
answers137
viewsPostgresql Query - How to do this?
How to make an SQL query in this table: ID Col2 Col1 -- ---- ---- 11 1 A 12 2 D 13 3 G 14 1 B 15 2 E 16 3 H 17 1 C 18 2 F 19 3 I To return this result: 1 A B C 2 D E F 3 G H I Is that even possible?…
-
0
votes1
answer827
viewsTimeout while Getting a Connection from pool
You’re making this mistake. I’m using postgres Erro ao buscar servidor por id: Timeout while getting a connection from pool. A first chance exception of type 'System.Exception' occurred in…
-
0
votes1
answer336
viewsReturn last entry of each object in the database
I have two tables: monitor_carro id serial | setor_id | modelo | ano | placa monitor_evento id serial | lat | long | data | fkfuncionario_id | time | carro The monitor_event table has only one…
-
0
votes1
answer485
viewsPostgresql Constraint error
I have a code that is giving the following error: there is no Unique Constraint matching Given Keys for referenced table "schedule" Code: CREATE TYPE weekday AS ENUM ('Domingo', 'Segunda', 'Terça',…
-
0
votes1
answer563
viewsJqgrid. onSelectRow - Grab field id and pass url
Oops, I have the following code: // jqGrid // $grid->('onSelectRow', "fnHistoricoPessoa"); // fim jqGrid// // função para onSelectRow// function fnHistoricoPessoa(){ var kwGrid =…
-
0
votes0
answers90
viewsReturning an empty table
create function teste( teste varchar ) returns setof record AS $$ begin execute teste; return ; end; $$ language plpgsql; select teste ('select * from public.opcional '); This returning me record…
-
0
votes2
answers690
viewsSQLSTATE[42703]: Undefined column: 7 ERROR: column Alis.column name_column does not exist LINE 1:
I have a page on my system that does a file transfer, it just does an update on the table. I copied the lines of this code and put it to work on another page, changing only the names of fields and…
-
0
votes1
answer634
viewsError connecting Postgres to remotely
I am having problems connecting to the company database, I am accessing from home. My other colleagues can access normally. Both saw pgAdmin how much terminal I have been facing problem. Strange…
-
0
votes1
answer145
viewsSyncing the Desktop and Mobile Database?
Well I will start working on a LARGE project, which will be MULTIPLATFORM, both for Desktop and Mobile, and we are discussing a way, to work with the DATA BASE in both applications. The interactions…
-
0
votes2
answers5572
viewsConnect application to Postgresql?
Rstou wanting to connect a simple application made in C# to a Postgresql database, what I would like to know is if the procedure is similar to Java, in which I have to create a connection class, a…
-
0
votes2
answers215
viewsIgnore dot in a Query
I am trying to run the following Query: select codigo from cliente where codigo ilike '%99.999.999%'; I thought by putting the ilike, he would ignore everything, points and accents but I was wrong.…
-
0
votes2
answers176
viewsAs foreign key reference alternating tables
I have a City, State and Country Database. But I want to add Cities to my table and it doesn’t always contain a state to be referenced. However, every city is located in a country. My question is:…
-
0
votes1
answer112
viewsquery optimization that adds values according to a clause
Hi. I have a query that I must bring two columns, and one of the columns will return the value of a column, plus the sum of another column respecting the Where clause to add the values. I came to…
-
0
votes1
answer51
viewsHow to improve Testcase speed in Django?
I’m running a test on Django with only two querys and the timer is taking 1 min and 10 seconds to complete the test. Is there any settings you can adjust to speed up the tests? I’m currently using…
-
0
votes0
answers724
viewsWamp + Laravel 5.1 + Postgresql
Someone already set up Laravel 5.1 to run on Wamp using postgresql database? I have an Laravel installation running on a WAMP server, but when running the "php Artisan migrate" command I get the…
-
0
votes0
answers90
viewsHow do I make an incremental backup script in a postgresql database?
I would like to know how to make a script . sp1 to make a daily incremental backup? Gratitude!
-
0
votes0
answers63
viewsPHP warning for no reason!
I want to make a simple connection to the database but each time I test, after a long page load generates a Warning. File database.class.php: <?php abstract class banco { public $servidor =…
-
0
votes0
answers89
viewsPostgres JDBC error in Eclipse
I’m trying to do a project to test the connection in the Postgresql database (I’m using version 9.2) in Eclipse (Mars version). I am using postgresql-9.2-1004.jdbc3 and adding it to the Build Path.…
-
0
votes1
answer103
viewsConnection problems with Postgresql(ghost URL)
I am working on a web java project and have a connection class with the Postgresql database ,which connects the database called BASE_X which performed well, but I made a copy of the project that has…
-
0
votes2
answers153
viewsIs it possible to use between to filter searches with a Character field?
For example, if I am going to do a database search of a table with the price of the products, I use in my condition Where: preco_product between 10 and 550 but and for me to do the same type of…
-
0
votes1
answer27536
viewsHow to include or remove enter, line break, new line from a string - Postgresql
How to remove or include "line break", "enter", "new line" from a string result in postgres. The result is: comentário Texto do comentário Mais texto And I want to: comentário Texto do comentário -…
-
0
votes1
answer438
viewsHow do I handle data from a Date search in the Where clause in Postgres?
I have a screen where I have a list of a company’s payment titles, and I need to do a dynamic search from the issue date of the title. The idea is that when the user enters the date in a search…
-
0
votes2
answers96
viewsServer instance restuful in Tomcat
Staff developed an app - https://play.google.com/store/apps/details?id=br.com.apprioconcurso I am using a server restfull connection to the postgree bank in Hibernate. This server is hosted in…
-
0
votes1
answer137
viewsSql - Merge select - Create Row if nonexistent record
I’m willing to join two SELECT, but I am unsuccessful. Has the following tables: CREATE TABLE tb_producao ( cd_producao SERIAL, cd_setor integer, nr_quantidade numeric(12,2), ds_producao character…
-
0
votes1
answer56
viewsSQL Query according to the Make a New Column
I have a column that is numerical. In this column there are positive and negative values. I need to make an appointment that when I’m positive, I’ll consult Tabela A, when negative I refer to Tabela…
-
0
votes0
answers108
viewsRestful server error in Tomcat
Could someone help a server problem REST? I’m developing an app android and I’m working with a server restful, database Postgres and Tomcat. And I’m making that mistake almost every time I make…
-
0
votes1
answer599
viewsQuery Performance - Postgresql
I have the following situation, I need to bring data from a vehicle table of the system in which I work and another with integrated data of a partner system, for being integration the data are not…
-
0
votes1
answer30
viewsSearch using between no postrgres
I am performing a database search in order to return only the characteristics that are between the range of 40 and 100. But when running the script below it is returning me other features that are…
postgresqlasked 9 years ago Gabriel Schmidt Cordeiro 728 -
0
votes1
answer105
viewspsycopg2.pool.Simpleconnectionpool, Operationalerror exception takes time to launch
I ran a test, shut down the server and called the method psycopg2.pool.SimpleConnectionPool, the method is waiting for a response for a very long time, about a minute, only then it raises the…
-
0
votes1
answer506
viewsSelect in the database, only with jQuery
How do I make a select in the database using only a jQuery? I have two combobox and want to use their value to make a select in my database: $.getJSON('/MinhaDoenca/rest/hospital/get',…