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
-
48
votes0
answers1178
viewsWhy are cost estimates in Postgresql so wrong?
Could someone help me understand why Postgresql missed several cost estimates in an experiment I did. I’m doing an experiment with 22 darlings of Benchmark TPCH[1], to verify index performance in…
-
45
votes5
answers41645
viewsWhat are the advantages and disadvantages between Mysql and Postgresql?
I have been with this doubt for a long time, I see some people recommending the use of Postgresql, but it is not clear the advantages and disadvantages compared to Mysql. I want to define the bank…
-
15
votes3
answers4552
viewsUse VARCHAR(255) for all fields or choose the best size for each field?
Assuming the following fields (for example): Nome, Rua, Cidade ,UF. The Nome would be the client’s name. There are people with 2 short names or people with 5 or more names, so it is possible to have…
-
13
votes4
answers10456
viewsWorkbench for Postgresql
Does anyone know of a Workbench for Postgresql? I need it because I don’t want to mess with postgres per command line.
postgresqlasked 8 years, 9 months ago Jessica Costa 381 -
12
votes3
answers23020
viewsHow to initialize postgresql with Ubuntu?
I have the following problem, every time I turn on my machine, I go to the terminal and give sudo service postgresql status, always appears 9.3/main (port 5432): down. On other machines I have…
-
12
votes1
answer398
viewsWhy does the SQL language vary from DBMS to DBMS?
I was used to using SQL for Web projects, always using Mysql. One day I had to write a C++ program that used databases. At first I chose Sqlite but needed other computers in the network to connect…
-
10
votes1
answer236
viewsHow to make Dbunit recognize the POLYGON data type of Postgresql?
I have the following dominance of the type polygon in the database: CREATE DOMAIN "global".polygon AS pg_catalog.polygon; The following table using this domain: CREATE TABLE user.area_geom (…
-
10
votes3
answers10991
viewsHow to escape quotes in Postgresql?
I have a postgresql function function f_criaproduto(p_texto text), I have to go this way f_criaproduto(' meu produto é 'televisao' da melhor qualidade'). How can I escape the quotation marks in the…
-
10
votes1
answer5591
viewsHow to make SQL query that ignores uppercase, lowercase and accents?
I have a database with registration of several films, and I would like to create an SQL query that ignores the presence of capital letters, lowercase, accents and ç. For example when searching for…
-
10
votes2
answers7796
viewsUse timestamp with or without Timezone in postgresql?
Use timestamp with or without Timezone in Postgres? The web application will be used in different countries, so I will have to deal with different time zones. The system has data entry from several…
-
9
votes1
answer230
viewsWhat is the difference between pg_query and pg_execute?
I’m new to Postgre and I see pg_query and pg_execute in the application I’m working on, however I can’t see the difference between the two. I have to make an insertion and I’m not sure which to use.…
-
9
votes2
answers144
viewsIs it redundant to use LIMIT in a QUERY whose ID is the primary key?
My question is if using LIMIT there will be some performance gain in the QUERY. Example: SELECT descricao FROM produto WHERE id = 9999 LIMIT 1 Has better performance than? SELECT descricao FROM…
-
9
votes1
answer261
viewsMirroring of Database
I am developing an application in Java using database PostgreSQL, locally. I would like to know if there is a way to mirror my local database to an external server? Is there an API on Java for that…
-
9
votes1
answer568
viewsHow does inheritance work in Postgresql?
How does inheritance work in Postgresql? Is it a good practice in relational databases? How to use it?
-
9
votes2
answers1680
viewsDisconnect case sensitive in Postgres
When I make the command select * from tabela where name like '%teste%' the line with the name TesTe returns, but the same does not happen in postgres, I do not want to put lower(name) to work, how…
-
8
votes1
answer3372
viewsSql - Select first and last record
I have the following tables: CREATE TABLE tb_lote ( id_lote integer NOT NULL DEFAULT nextval('tb_lote_seq'::regclass), ds_lote character varying(255), CONSTRAINT pktb_lote PRIMARY KEY (id_lote) );…
-
8
votes3
answers1596
viewsHow to order records in the query according to another ordination?
I have a table with the following columns: id - id_manager - value - source - id_source When registering an "Account to Pay", insert in this table managerial breakdowns of the company. Assuming that…
-
8
votes2
answers13586
viewsHow to install the PDO_PGSQL driver in Ubuntu?
I have already installed PHP 7, Apache 2 and Postgresql 9.5. I’ve already enabled the extension on php.ini but it doesn’t work. In Windows just enable this extension on php.ini that already works…
-
8
votes3
answers10321
viewsselect from date in postgresql database
As I make a select in the postgresql database for it returns the data from a specific date, for example I have a field of type timestamp with name data_interview, I want it brings me the data…
-
8
votes1
answer10401
viewsDifferent timezones in an application with Postgresql
We have a system that serves several distribution centers. A distribution center is a physical location that can be located anywhere in the country. A single customer can have several centers. Our…
-
7
votes3
answers6508
viewsDifference in postgresql date months
I need to catch the difference of two months dates, for example 16/03/2013 until the date 16/07/2014. If I do select extract('Month' from age(data1, data2)) What will return is a result 4, as it…
postgresqlasked 10 years, 4 months ago lionbtt 1,211 -
7
votes2
answers5639
viewsRescuing the last insertion in the bank with lastInsertId PDO
I’m trying to rescue the last id in the bank with lastInsertId() of the PDO, but nothing appears. OBS: I’m using the Postgre. <?php try { $dbh = new…
-
7
votes1
answer758
viewsSimple data replication in Postgresql
I created two tables with primary key and needed to replicate them, database but all on the same machine. How should I do this? The tables created are these: CREATE TABLE cities1 ( city varchar(80)…
-
7
votes2
answers6186
viewsFunction equivalent to "DISTINCT ON" in Oracle BD?
In Postgres, you can make distinct apply to only 1 select field using the DISTINC ON, how can I reproduce this function in an Oracle database? Follow an example query: SELECT DISTINCT ON (CITY)…
-
7
votes2
answers249
viewsComparison with Postgresql database using C#
I created a Login application, made the connection to the database, I can get the user and password registered in my database. But what I want, is, if the user tries more than three times to enter…
-
7
votes1
answer5885
viewsWhat are INDEX, B-Tree, hash, Gist, and GIN?
In the the Postgresql Manual has the following excerpt : Postgresql provides the index methods B-Tree, hash, Gist, and GIN. Postgresql provides the B-Tree, hash, Gist and GIN index methods. But…
-
7
votes1
answer104
viewsProblem with . Include() in Entity Framework(Postgres)
I’ve been having a problem with Entityframework, it’s as follows: When I use the ORM(.Include) string to give a Join in tables with foreign keys, it automatically changes the name of the keys in the…
-
7
votes1
answer693
viewsMysql Code Translation for Postgresql
I need to convert a Mysql page into Postgresql commands, but I’ve already reviewed the internet looking for similar commands and Postgresql syntax, and was unsuccessful. Some commands do not exist…
-
7
votes4
answers19788
viewsHow do I update with a Join?
Hello, I’m new to the forum and I need some help with SGBD Postgresql. My doubt 'and the following, in the following code used in DBMS Mysql the execution happens perfectly, by'em in Postgresql…
-
7
votes3
answers629
viewsEF6 + Postgresql - 22021: invalid byte Sequence for encoding "UTF8": 0xc9 0x52
I am trying to get data from a Postgresql database with Enconding SQL_ASCII, but in some records I get error message "22021: invalid byte Sequence for encoding "UTF8": 0xc9 0x52" I have tried to set…
-
7
votes4
answers17451
viewsHow to check Postgresql logs?
I have a legacy database that when doing certain action in the system that has access to it, several tables are modified, I was able to identify at least 04 tables being changed. My question is…
-
7
votes2
answers758
viewsWhat does the return of the INSERT 0 1 bank mean?
When I perform commands in the bank I have returns to and execution of the same. Doubt What does the 0 in INSERT 0 1? Example CREATE TABLE test( id SERIAL, name VARCHAR(50), PRIMARY KEY (id) );…
-
6
votes2
answers10814
viewsHow to set password for Postgresql administration?
I installed Postgresql on my Ubuntu using "apt-get". I’ve been using "sudo" to perform operations (actually following a tutorial), but now I want to manage DBMS with a client that asks me the…
-
6
votes1
answer5097
viewsHow to group by month with SQL?
I have a table, for example, with an attribute nome and data (for example only). I would like to generate a query that returns the amount of each row grouped by name and month: Nome Janeiro Fev…
-
6
votes1
answer240
viewsPostgres Decode and convert_from error
Has anyone been through the Postgres issue to error the Code Base64? I have the following call that informs [Err] ERROR: end of sequence is invalid convert_from(decode('YnJhc2lsc2VtbGVp', 'base64'),…
postgresqlasked 10 years ago Jorge Kania 192 -
6
votes2
answers1150
viewsSort month that is in full in Postgres
I need to make a ORDER BY in a table mes which has the months in full and in Portuguese (Janeiro, Fevereiro...). It has no relation to any other column in the table. It is possible to do this?…
-
6
votes1
answer266
viewsHow to create a scan sequence in the Postgres database?
I have the following table in the database Postgres: CREATE TABLE customer ( userid character varying(30) NOT NULL, firstname character varying(30) NOT NULL, lastname character varying(30) NOT NULL,…
-
6
votes1
answer890
viewsHow to maintain multiple connections with postgresql in Node.js?
I am used Node.js in a task where I need to migrate data between two Postgresql databases. The idea is more or less the following: Connect to Bank A. Connect to Bank B. Return all records from A.…
-
6
votes2
answers402
viewsPass ROWTYPE parameter with the EXECUTE command
I am developing a function in Postgres that aims to recover for each record of a query the result value of a check contained in a set of functions. Of these functions only one will return the…
-
6
votes2
answers195
viewsInserting single quotes into null fields
I created a very simple application to simulate a small client registration, but when testing the manipulation of data by the application I could see in the database that the fields that are null in…
-
6
votes1
answer230
viewsFilter Postgresql Information on Windows Forms screen using Entity Framework
Is there any way to search for the information in postgresql by nickname? But without using alias, only in the field register in the table I already enter the real name for the field? Example:…
-
6
votes2
answers1493
viewsSyntax difference between databases
What is the difference, in the syntax, of the following databases, for a simple query, of the type: SELECT * FROM tabela WHERE id = '1' ORDER BY nome GROUP BY nome LIMIT 1 Or, what do they differ…
-
6
votes2
answers1345
viewsChange Boolean column to integer
I’m using a database that has a field called: status: boolean, but I want to store in it the values of the radio button (0,1,2) so I need to change to integer. I’ve tried to: ALTER TABLE OS ALTER…
-
5
votes1
answer2169
viewsProblems with slowness Delphi and Firedac
I have an application developed in Delphi XE and a month ago I changed the whole persistence structure that used to use ADO for Firedac. In the compatibility of the new persistence component I used…
-
5
votes2
answers427
viewsView "View" from Postgres in Mysql. Is it possible? How to Do?
Is there any way to view a View created in Postgres and view in Mysql? If so, how to configure?
-
5
votes4
answers860
viewsSelect with indefinite amount of conditions
The thing is, I have a field of research, and I want to search in different places than what’s registered, like this: tenis nike shox preto. I put in research: tenis preto. If I use a description…
-
5
votes2
answers3824
viewsWhat is the best way to save files, Bank or File System?
I have a demand to attach Pdfs to my application. The files have varying sizes, from 5 to 200 MB or more. Here comes my question: what is the best option to store? Direct in the database…
-
5
votes2
answers2138
viewsJava and Postgresql/ MYSQL encryption
Hello I’m having a question in my college project, in scope it says like this: "Users and passwords can be stored in the database, using the database’s own encryption." Is the crypt in both by…
-
5
votes3
answers1803
viewsTables/Temporary content in the database?
Situation I am wanting to manage a process using the resources that database offer, as INSERT, UPDATE, DELETE. However all this process is temporary, that is, I have to generate tables and data that…
-
5
votes1
answer124
viewsUpdate Table in Postgresql
I have the following question in Java: how can I pass to SQL that it should capture the "date and time" of the computer and update the User Table in Postgresql? Follows code: public class…