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
votes2
answers554
viewsUpdate and Insert data into a table with information from another bank
I have the following situation: Bench To and the bank B both with the table customers with the following data: A.clientes B.clientes id | nome id | nome ------------------- ------------------- 1 |…
-
1
votes1
answer928
viewsBackup and Restore using Postgresql in C#
To back up or re-store a database through a C# application using the Postgresql DBMS, you need to send a command to pg_dump. It is possible to execute it via a select by sending an Executenonquery…
-
1
votes1
answer69
viewsHow to perform an SQL command that fills several lines
I have a table where there are several records of supplies, now will be implemented a column in this table where will be saved a label that facilitates to find these supplies in the stock, I have…
-
1
votes0
answers106
viewsReport in c#
I’m trying to develop a report(report) in C# and using the ReportViewer for display. I am using the SGBD Postgresql, and I’m unable to make the connection to the database and the report, to get the…
-
1
votes1
answer1699
viewsHow to calculate the time difference between certain hours?
public function checks($request) { $token = $this->count->All(); foreach($token as $tokens){ $tokens->system_contador_user_update_at With this I take the time that is recorded on the bench…
-
1
votes0
answers670
viewsLogin pgAdmin 4
I installed pgAdmin 4 in Debian and when accessing the login screen it asks me for email and password. I expected it to ask the user "postgres" and password. I would like to know how to register…
-
1
votes2
answers128
viewsVisual Studio Installer Projects with Postgresql
I am starting a Windows Form C#project, a commercial application that the user downloads, installs and uses, without complications. It is possible to configure Visual Studio Installer Projects to…
-
1
votes2
answers78
viewsDate problem in Postgresql
I have this query below and I want faturamento, ticket_medio and qtd_pecas, qtd_atendimentos, be divided by the numbers of Tuesdays. Example had 5 Tuesday fairs with registered values in this view,…
-
1
votes1
answer340
viewsHow to search for a string that varies from position
See below two results returned from a table where I store sqls query execution plan. I use POSTGRESQL I need to capture only the string cost=399301.55 of the result below. The word cost always comes…
-
1
votes1
answer1564
viewsUpdate Postgresql by Pgadmin without SQL command, but by Interface
I need to change certain data from my database PostgreSQL for PgAdmin but I’d like it to be straight through the PgAdmin and not through SQL commands, this is possible. For example when I want to…
-
1
votes0
answers207
viewsError importing file with accents - Postgres
Guys, I need to copy a physical file from one directory to another, but for this I need to use Postgres. I’m using LO’s functions to do this. I can perfectly copy the file when it has no accents,…
-
1
votes1
answer395
viewsJava null data insertion error, Java Postgre database
I am trying to insert data into a table in the database, but returns error "null". public void cadastrarChamadas() { Chamadas1 cha= null; String sql = "Insert into tb_chamadas(cha_cod , cha_nome,…
-
1
votes1
answer696
viewsSearch records referencing the same table
I own a table that she owns an fk for herself. The point of this is to assemble a history of the previous records, so I have the id and id_previous column, and the previous id_fk for the id column.…
postgresqlasked 7 years, 3 months ago Matheus Hahn 57 -
1
votes1
answer1539
viewsERROR: column "type" of relation "tb_person" does not exist
Hello. I am trying to persist a record, but when I run, it is returning the error below: // ... @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn(name = "tipo", discriminatorType…
-
1
votes0
answers789
viewsProblem with extension of Postgres PDO
Use apache+php7+postgres on Ubuntu and it works well. But now wanted to do the installation by hand on Windows 8.1 and found a problem: I installed Apache 2.4, PHP 7.1, and Postgres. Apache worked…
-
1
votes2
answers1172
viewsPostgresql changes letter with accent
Look I’m saving data on SGBD Postgresql, only that the data (NAME, CITY, STREET), I am saving in capital to facilitate when searching. He’s saving normal, the problem is that when I save a word in…
-
1
votes1
answer167
viewsError Running a query with npgsql + Dapper in postgresql
I can capture my "user" object that has inside of itself a "Login and a Password" and, when executing the function by my ORM, I catch the following error message: {"42883: operator does not exist:…
-
1
votes1
answer876
viewsHow to make an INSERT in postgresql with conditional default value?
We have the following simplified table for the example: create table teste( id serial not null ); The commands below cause syntax error: insert into teste( select (case when 1=1 then DEFAULT end) );…
-
1
votes0
answers333
viewsCreate select with multiple conditions
I have a table with several record of calls and I need to perform some conditions, to separate records. I already use select to validate the information SELECT count(*) as qtdade_status_dia,…
-
1
votes0
answers70
viewsHow to save date (yyy-MM-dd) and time (hh:mm:ss) in Postgresql?
I need to store in the Postgresql database the date and time that a particular record has been changed or inserted, but when creating this column I was in doubt about which format to choose,…
-
1
votes2
answers1681
viewsSuitable type to use with CPF is numerical or character?
I have a database with two tables that store the CPF. In one of them the CPF is stored as numeric(11,0) and in the other the number is stored as character. If there is any difference, which of the…
-
1
votes3
answers196
viewsQuery listing the dates
Good night, How Query can get the following action in Postgresql: List the dates that fell on Sunday of the last 6 months based on the current date, regardless of the data in the database. NOTE: The…
-
1
votes1
answer45
viewsHow to migrate Posgresql Script to Mysql Script?
I have this database in Postgresql Script, how to convert to Msyql in order to create this database in this database ? -- -- PostgreSQL database dump -- -- Started on 2010-07-03 09:40:14 SET…
-
1
votes1
answer1643
viewsHow to create Server in Postgresql with port other than 5432?
It is possible to create a server within the Postgresql database with a port other than 5432 ? It is possible to have Server1: Postgresql at port 5432 and Server2: Test at gate 5433 ??…
-
1
votes2
answers414
viewsIs there a security problem using the public schema in Postgresql?
First time I’m working with postgresql and I’m wondering if you have a security problem using the public Schema it creates ? Or if it’s just a matter of organization
-
1
votes1
answer82
viewsNullreferenceexception when trying to write to database
I have this error, when I will record the form data in the database. Error: System.Nullreferenceexception: System.NullReferenceException ocorrido HResult=0x80004003 Message=Referência de objeto não…
-
1
votes3
answers2562
viewsSum the values of a Count(*) in sql
I’m new in sql and I’m having a hard time making the sum total of the values of a Count, follows below the code: SELECT A.Pais, count(*) from Aeroportos A left join Estacoes E on A.Sigla = E.ICAO…
-
1
votes1
answer252
viewsRunning a system command with parameter inside a Function in Postgresql
I’m having a hard time create a function in the Postgres execute a command shell linux, with one detail: it is a function in a Trigger after insert and I need to use some columns from NEW. In Mysql,…
-
1
votes1
answer250
viewsC# Postgree Connection Error - Locaweb
Dear I have a webservice consuming postgreesql data and when I try to connect with the base after posting. The host I’m trying to use: "servoripanema.no-ip.info" Npgsql.Npgsqlexception: Failed to…
-
1
votes2
answers145
viewsProblems with Bake in Cakephp 3.x "Your database does not have any Tables."
Greetings! I’m trying to generate models, controllers and templates in a Cakephp 3.x project using the Postgresql database. I’ve already created the tables, set up the connection (which is working…
-
1
votes1
answer242
viewsCast parameter Postgresql function DEFAULT null::int
I am trying to create a plpgsql function in Postgres that receives null parameters as default. Example: create or REPLACE function spinserir_0200( p_id_entidade integer DEFAULT null::int ,…
postgresqlasked 7 years, 7 months ago Robss70 1,609 -
1
votes1
answer127
viewsDoes not return the amount of records from the Postgresql database
I would like to know the amount of records in my database, but does not return the amount. Look at the records in my database SQL command Select count(*) as contaRegistros from tb_produtos where…
-
1
votes2
answers528
viewsPostgres-case when
select x.codigo,x.nome,x.cpf,x.contato, x.limite_credito, x.pendencia as pendencia from ( select p.codigo,p.cpf,p.contato,p.limite_credito,p.grid,p.grupo,p.nome,…
postgresqlasked 7 years, 6 months ago Ronailson Gomes 11 -
1
votes3
answers8105
viewsLIKE and IN command in the same SQL command
It is possible to use like and in in the same SQL command? For example, I need to search in the table stockpile the Serial Number that can be 'SCAB171293E29','SCAB171293E4E' but they might have…
-
1
votes0
answers505
viewsPostgresql connection problem
My newly installed Postgresql gave this error: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and Accepting TCP/IP Connections on…
postgresqlasked 7 years ago wladyband 4,694 -
1
votes0
answers49
viewsTransaction with Entitiframework 6.1.3 and Postgressql does not work correctly
I’m trying to use Entityframework6.Npgsqlcom transaction, however I get an Exception when I call the Dbcontext.Usetransaction method and pass a transaction. Error message (Last Innerexception):…
asp.net-mvc postgresql entity-framework-6 asp.net-web-apiasked 7 years, 6 months ago Maicon Matsubara 11 -
1
votes1
answer2563
viewsImport XLS to Pgadmin
I am trying to import a spreadsheet with information from a database table, however, when I try to import, give the following message: field 'md5' must have a value However, there are values in this…
-
1
votes0
answers47
viewsError giving Migrate command for postgres
Good afternoon, my friends. I am unable to perform the migrate command in the Windows to the postgres. I changed the settings, enabled the driver, but nothing works. Any idea? database.php:…
-
1
votes1
answer171
viewsTable names in Hibernate are created with lower case letters
I am trying to turn the following Entity into a table in Postgre using Hibernate @Entity @Table(name="Usuarios") public class Usuario implements Serializable { ... } the problem is that when the…
-
1
votes1
answer113
viewsUpdate Postgresql
I have a question, a customer reported that there was an error in the registration of his products, and the employees registered the cost price as the price practiced and vice versa. Could I run an…
-
1
votes1
answer460
viewsHow to convert day of year to date (without timestamp) [Postgresql]?
I have the value 2016001 symbolizing the first day of the year 2016, how do I catch for example the ANO/MES of 2016263? Example: ENTRADA: $data = '2016001' SAÍDA: $anomes = '2016-01' If only I could…
-
1
votes1
answer470
viewsI cannot do a function that returns a Semester of a Date in Postgresql
I’m trying to make a conversion that returns a semester of a date, but this error has appeared here CREATE or REPLACE FUNCTION semestre ( data timestamp ) RETURNS INTEGER AS $$ BEGIN IF data <= 6…
-
1
votes2
answers7809
viewsHow to create postgresql tables using automatic primary key id generation?
I want you to forgive me for this posting, maybe it’s someone’s question, but come on... I know that the programmer has to master some things, and these things are considered as triads, for example;…
postgresqlasked 7 years, 5 months ago wladyband 4,694 -
1
votes2
answers1257
viewsFilter in WHERE Postgresql
Good morning guys, next, I’m doing a standardization of some records here in the company. So there are 2 tables. Table A(old records) columns as: id_alvara | logradouro 1 | Rua Sete de Setembro n°…
-
1
votes2
answers75
viewsIs it possible to do an Update this way?
I have two tables, the Table Impressoras is where is stored the data of the equipment, as model, patrimony, etc. And I have the table Impressora Local where the location of the printer is stored,…
-
1
votes1
answer134
viewsHow to return driver names in SQL table?
I have the following tables below, and I would like to return only the name of the pilots who never participated in a race in a Brazilian circuit in the country brasil. Table structure: PAIS (id,…
-
1
votes1
answer1258
viewsphpPgAdmin: "Identification disabled for security reasons"
When installing the phpPgAdmin on Linux, the following message appears: "Identification disabled for security reasons". What can it be?
-
1
votes1
answer149
viewsTesting UPDATE in Postgres
The idea is to do a search with the BEFORE result, run UPDATE with the appropriate changes and run a new search with DEPOIS, then undo all the changes, a test for UPDATE. SELECT id_evento,…
-
1
votes1
answer65
viewsDate field display
I have a date in the format americado yyyy-mm-dd and I would like to put it in the Brazilian format dd-mm-yyyy but I don’t want to do it as conversion to_char. I need you to continue with the date…
-
1
votes2
answers157
viewsRevoke in TEMPORARY TABLE in Postgresql, is it possible?
It is possible to give a REVOKE (Privilege removal) so users don’t create temporary tables? The CREATE TABLE I need to keep, however, I need to block the TEMPORARY TABLE. It is possible?…