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
answer74
viewsRestore backup in Plain Fomate
How to restore a Postgresql backup in format Plain ?? The server is Windows. I already tried in SQL Shell, but it seems that you can’t find the file. banco=# <…
postgresqlasked 4 years, 11 months ago Luis Alberto 21 -
-1
votes1
answer25
viewsHow to convert a Mysql view to Postgresql?
I’m making a migration from a Mysql database to Postgresql, but my view is not being accepted, I’ve been all over the internet looking for a way to modify it no longer worked, someone knows how it…
-
-1
votes1
answer54
viewsUpdate json object in a varchar column
Guys I’m having a problem at Postgres, I have a column that’s in format varchar but as a need I have to put a saved JSON object in it {"value": "value", "value2": "value2"} It is possible to update…
-
-1
votes1
answer99
viewsRecover DB data from a certain date
I am creating an api in Node.js, using express and Sequelize as ORM. I would like to know, which expression should I use to recover DB data from a certain date. I’m using the date-fns to determine…
-
-1
votes1
answer275
viewsHow to know which ip has connected to a postgresql database?
The question is the same as the title: How to know which ip has connected to a postgresql database? It’s just that I’ve cleared the external access and I need to have some control of where the…
postgresqlasked 4 years, 10 months ago Italo Rodrigo 4,344 -
-1
votes1
answer2496
viewsChange Pgadmin4 default browser
Today when opening the PgAdmin4, it opens by default on Edge of my machine. It is possible to change this to the chrome? When just trying to copy the link and paste, it doesn’t work. Unauthorized…
-
-1
votes1
answer207
viewspgAdmin - How to install "system Tray plugin"?
I use pgAdmin 4 in Linux Mint 19.3. Whenever I open the program, in addition to the browser, a pop-up appears saying: Note: Installing a system Tray plugin will Prevent this window being Shown. I…
-
-1
votes1
answer187
viewsResultset Return null in Java
I use the code below to check in Postgre if the table exists, running the Query in Pgadmin have as answer value null. But apparently Resultset will never return null. Is there any way to compare RS…
-
-1
votes1
answer25
viewsWhat are the commands of a Superuser?
I would like to know what are the Rights that a Superuser has within a database. He can make what changes?
-
-1
votes2
answers52
viewsFor better performance in the Postgresql database is it better to have the products divided into smaller tables?
Hello, I’m developing a system to manage the sale of several real estate developments. In this system each enterprise has a group of units available, type "Apartment 21 - 2nd Floor, Apartment 34 -…
-
-1
votes2
answers28
viewsInput value equal to ID?
Hello, I have a table in postgres that has a column called link, serves to connect data with the same origin of several tables. This link is equal to the ID of the table in question 'tasks'. How do…
-
-1
votes1
answer57
viewsHow to replace digits with "!" in SQL (postgresql)
Good Afternoon, I am trying in an output to exchange all digits in the address column for a '!'. I tried the following solution among others, but for some reason I’m not getting what I want. select…
-
-1
votes2
answers87
viewsHow to use rowCount to limit the number of records in a postgresSQL database using Node js?
I’m using the script to do this, but I get the error Internal server error. Anyone knows what I’m doing wrong? var sqlQtd = db.query(`SELECT COUNT (*) FROM segunda`, function(err, result){ return…
-
-1
votes1
answer40
viewslimit links in php posgresql paging
I have this code that makes me pagination, but I intend to limit to 4 links to each side. The intended: Previous,11,12,13,14,15,16,17,18,19,Next Current code: $qry1= pg_query($dbconn,"select * from…
-
-1
votes1
answer143
viewsTake the lowest values of a Count using group by
Cheers guys, I have the following problem... The query below is almost perfect, but it is generating repeated Ids, what I need is the lowest Count value of each ID. The ideal result would be: ID |…
-
-1
votes1
answer41
viewsUnion Junction Operator
I need to present the departments that had stock movement in Feb/2018 and those that had in Mar/2018. I need to use a union operator to show the results of the two queries each of them returning the…
-
-1
votes1
answer40
viewsSQL queries with multiple tables
I am studying SQL and needed to make a query, which for me is more complex. I have the following tables: Tabela Ativo: id, tipo_ativo Tabela Carteira: id, nome.. Tabela Movimento: id, ativo_id,…
-
-1
votes1
answer54
viewsHow to display the metadata of Shape and raster files in Postgresql?
Good afternoon! First, this is the first post I do on the forum and I’m a beginner in the Postgresql/Postgis issue. I am working on a project that involves spatialized databases in which I need to…
-
-1
votes1
answer20
viewsQuery via dblink is giving error ORA-02022
Good evening, I am making a query by PL/SQL in a postgres database, connected by a dblink, in postgres the view is executed correctly, but when I consult through dbllink is giving the error…
-
-1
votes1
answer134
viewsExtension pgsql Does not load in PHP7.x
I am changing from PHP5 to PHP7 in windows 10 (development machine), all my settings have gone up good, Mysql, Firebird, PDO Mysql, PDO PGSQL, but the blessed Native PGSL does not go up, I have…
-
-1
votes3
answers72
viewsCode reduction in sql query
I created a query with the following objective: Select all the tools which the inventories theirs nay are gifts in all businesses. One Tool has one or more stocks, a stockpile belongs to only one…
-
-1
votes1
answer39
viewsTrigger SQL Server
I have this Trigger in Postgresql and I’m having a hard time turning it into SQL Server. -- Trigger -- CREATE TRIGGER livro_original BEFORE INSERT ON tabela FOR EACH ROW EXECUTE PROCEDURE…
-
-1
votes1
answer60
viewsJOIN - Beginner’s Question
I have a question about full outer join, I researched and still do not understand. The last figure below explains, graphically, the operation of full outer join, that returns only the data not…
-
-1
votes1
answer60
viewsConfigure JPA to recognize uppercase Postgresql entities and tables
Recently I am working in a project that uses as DBMS Postgresql. In the database all tables and columns are in "UPPERCASE". Example: CUSTOMER - ID_CUSTOMER - NAME - DESC When it comes to mapping…
-
-1
votes1
answer378
viewsERROR: Missing FROM-clause entry for table "new"?
Hello, I’m making the following mistake: ERROR: Missing FROM-clause entry for table "new" CONTEXT: Error occurred on dblink Connection named "unnamed": could not execute command. SQL statement…
-
-1
votes1
answer58
viewsCommand c connect asks password I did not create [Postgres]
Hi, I created the table controle_compras and it all worked out. I inserted items as indicated in the class, but only as an exercise, I started to create another table only to train the commands. But…
-
-1
votes1
answer111
viewsPHP with PDO returns full SQL date
I have a PHP application that reads data from tables that can be SQL or Postgres. When I started using PDO instead of mssql, the SQL data fields return ex: 'Nov 29 2019 12:00:00:AM'. If you query…
-
-1
votes1
answer96
viewsQuery sql nodejs loop
Hello I’m with a doubt I think they could help me, to some problem in running a function twice in the same script example have this function exports.getValueMsg = function(){ return new…
-
-1
votes1
answer139
viewsHow do I bring records from the database by clicking on the checkbox using jquery and ajax?
Well, I can bring you data from the bank using ajax, but I want you to click on input of the kind checkbox, he performs the database query and shows me the data inside a flexbox. I have 10 checkbox,…
-
-1
votes1
answer48
viewsPostgres SQL query with table relations
I have a users table with the following fields: id username email password created_at updated_at A table followings with fields : id user_id contact_id created_at updated_at And a table with the…
postgresqlasked 4 years, 9 months ago Israell Llopes 41 -
-1
votes1
answer60
viewsHow to read data from a postgresql SQL?
Hello, Good afternoon I am relatively new programming, I have been working on a project that involves the mapping of some equipment, I did my part without problems but now I need to insert data from…
-
-1
votes1
answer239
viewsSELECT WITH CAST OR CONVERT TO AN ILIKE USING SEQUELIZE
I need to do a full-text search using sequelize, but when I place an iLike to search for an element of an integer or date type column, I can’t send a String, as I would a cast to search for that…
-
-1
votes1
answer124
viewsSequelize GEOMETRY type field
Hello, I wanted to create a table using Migrations with sequelize, and create a position field of type GEOMETRY. The bank I’m using is the postgres. I tried that code: 'use strict'; module.exports =…
-
-1
votes1
answer64
viewsSQL - search data from different tables without relationship with Ids
Personal table (id, cnae, cnpj, ...) (amount of records 40M) Table cnae_secundario (id, cnae, cnpj) has no attachment by id with the personal table. (amount of 50M records) The user will inform the…
-
-1
votes1
answer55
viewsPHP Notice: Undefined variable: Conn in C: Users Lucas php_Server DB manager.php on line 7
I’m having a problem connecting to the database, more specific to register a value I tried to make the connection here class Dbconnection{ private $conn; function __construct(){ $this->conn =…
-
-1
votes1
answer48
viewsQuery Problem C#/Postgres
I have the following method: private static List<ProdutosTmpModel> GetInListaPromo_caddespd(Dados dados, Empresa emp) { //busca todas os produtos das listas vigentes StringBuilder command1 =…
-
-1
votes1
answer109
viewsDelete repeats and return last Postgresql record
Good afternoon, I need to make a query to return the description of the records of a table, and there can be no repetitions of ID (of another table) and need to be the most recent record.…
-
-1
votes2
answers655
viewsDocker Compose + Postgres + Nodejs + knex API Connect in Bank
Hello I am studying Docker Compose, I made a simple API to make user CRUD, but I want to climb a container to run the Node and one with postgres and they communicating I did the following 'Docker…
-
-1
votes1
answer30
viewsHow to read a 'Boolean' column using NPGSQL?
I have the following code at the event Validated textbox: NpgsqlConnection conn = new NpgsqlConnection( "Server=127.0.0.1; port=5432;User; Id=postgres; Password=572600;Database=Sistema");…
-
-1
votes1
answer32
viewsDoubt in SELECT when creating a VIEW
Good afternoon, everyone, I need to create a VIEW in POSTGRESQL, example below: CREATE OR REPLACE VIEW test.nomedaview AS SELECT Tabela1.Cpf FROM test.Tabela1 UNION SELECT table2.cpfcnpj FROM…
postgresqlasked 3 years, 9 months ago Lucas Ximenes 3 -
-1
votes1
answer104
viewsScript for a particular SQL library
Imagine that a client contacted and requested the creation of a system to register the books of the private library, in your conversation with him you arrived in the following tables that the system…
-
-1
votes1
answer16
viewsHow to get the percentile of a sum in Postgres?
I have a table in Postgres that has daily rain data. How can I get the percentile of the annual amount of rain over the years? The table I have is like this: Date Rain 01/02/2020 4.2 02/02/2020 2.3…
postgresqlasked 3 years, 9 months ago arthurbbm 1 -
-1
votes1
answer37
viewsPostgresql installation error in Mint 19
I am trying to perform the installation of posgresql on Mint 19 when I received a dependency error, making some searches discover that I could try the command dpkg --configure -a, but I received the…
-
-1
votes2
answers92
viewsProblem in SQL search
I am doing an exercise where, for each name of a discipline, I need to return the number of students approved and failed. When I search for the approved and failed students separately, I get the…
-
-1
votes1
answer18
viewsProblem with update Trigger PLPGSQL
I have a Trigger for a stock audit, the Insert of it works, but the update no, or it changes nothing or changes all records with the same item code. How can I adjust this part of the Where of update…
postgresql function sql-update trigger plpgsqlasked 3 years, 6 months ago Camila Gabrielly Gonçalves 1 -
-1
votes1
answer30
viewsPersist entity history (objects) using Mongodb
I have the following entity (decreased from the actual entity): @Entity @SequenceGenerator(name = "produtoSequence", sequenceName = "sequenceproduto") public class Produto { @Id…
-
-1
votes0
answers9
viewshow to load database data on jsp jstl screen
ola have a jsp and jstl screen on the java system, on this screen loads database data by select, screen codico: <%@ page language="java" contentType="text/html; charset=ISO-8859-1"…
-
-1
votes0
answers18
viewsProblem using environment variables with Sequelize
I’m having a problem when I try to connect my database via Node setting environment variables. The variables I’m trying to set: file . env DIALECT_KEY='postgres' HOST_KEY=127.0.0.1…
-
-2
votes3
answers181
viewsSum of a column is not giving the expected value
I have a fictitious table with two columns and some data in it, according to the image. When I run my SQL statement below, the result of the query is 22. Shouldn’t the result be only 12? I couldn’t…
-
-2
votes1
answer84
viewsUsing LIKE together with BETWEEN
You can select data with the between along with the like, for example: public.retornotoner.observacao like between 'A%' and 'Z%' Or is there something that might be similar to that? Data example:…
postgresqlasked 6 years, 8 months ago R.Santos 2,251