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
-
0
votes1
answer36
viewsShow Postgresql data on web page
I’m new to the subject and ended up stuck in the web. I would like a help to display/search Postgresql database information and show on a web page. As I am learning Python, I would like help in this…
-
0
votes1
answer58
viewsConditional Postgresql
I’m new to the database and I could use a little help creating Rigger. I’m making a system where the user can open calls, I created a Rigger and need it to fire only when the type of call is…
-
0
votes1
answer46
viewsPOSTGRES) Questions about the blob dump
I’m at an impasse, but so far, even though I’ve done a lot of research, I haven’t found a viable solution. On a Postgresql9.6 server, I’m trying to back up one of the Databases. However, it has a…
postgresqlasked 4 years, 9 months ago Alisson Costa 26 -
0
votes2
answers155
viewsSave to Checkbox Database
I am in doubt on how to save a checkbox in the database. How to save a sequence of numbers to know which options have been selected. The last selected option is saved in the current form. Is there…
-
0
votes0
answers75
viewsHow to initialize persistence.xml at the beginning of the program?
I’m making a insert within a Postgresql database, however, as I have to test what connection to the database I will make, I end up having to configure the access based on each environment. The…
-
0
votes0
answers549
viewsPostgresql - sql:4862: ERROR: syntax error at or near "textGrande"
Good night, you guys. I am trying to import to my Postgres database an sql from an external database and am suffering the following error: .sql:4862: ERROR: syntax error at or near "textoGrande" The…
-
0
votes0
answers44
viewsHow to write a temporary table
I need to write a temporary table in sql to use in a subquery. I already have two ways, but they produce unpleasant effects. I imagine there’s another way to create this temporary table, but I…
-
0
votes1
answer226
viewsProblem when creating Many to Many association using Sequelize (belongsToMany)
I am getting the following error when defining a Many to Many association between two tables: C:\eadfabet\node_modules\sequelize\lib\associations\mixin.js:49 throw new…
-
0
votes0
answers53
viewsNon-uuid foreign key cannot be implemented
I am creating tables in a Postgre database, in the tables I use UUID as the primary key. For that, I executed: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; So I created the first table with: DROP…
-
0
votes1
answer228
viewsSequelize db:migrate error
Hello! I have a DB Postgres running perfectly on my machine. I can create my Migrations, for example in the following command: npx sequelize migration:create --name=create-users I am trying to run a…
-
0
votes0
answers50
viewsError when grouping per month with INNER Join using Postgres
Good morning! I’m trying to group my table by month but it’s not working.. I’m using this query: SELECT "Boleto"."id", sum("valor_parcela") AS "volume_operado", sum("spread") AS "spread",…
-
0
votes1
answer63
viewsPerform OR operation between two models in Sequelize
In my Proposal table I have two Foreign Keys that reference the same table(Producer), I need to make a Where to check if there is a producer with a document equal to the searched in one of these…
-
0
votes0
answers33
viewsHow to find the increased amount each month?
http://sqlfiddle.com/#! 17/5184a5/3/0 Dice: create table x (id int8 primary key, fk int8, date date, qty int4); insert into x values (292203, 10679, '2019-06-15', 65) ,(300207, 10679, '2019-06-22',…
-
0
votes1
answer29
viewsEscaping SQL "ILIKE" using bilbioteca psycopg2
I followed that topical here in the stack to try to create a select in which I look for a person using the ILIKE function, but I have the return of "None", even making changes in the column and…
-
0
votes1
answer348
viewsSELECT sequelize
I’m getting the error: (Node:20796) Unhandledpromiserejectionwarning: Typeerror: _Accessojs2.default.query is not a Function, I have the database configuration file: import Sequelize from…
-
0
votes0
answers45
viewsHow to show range of available times of the day based on marked intervals of the schedule of appointments in POSTGRES?
I need to show all available time slots for the day that don’t have appointments yet. Thus, you can choose the time still available to dial. I have already been able to detect overlapping…
postgresqlasked 4 years, 4 months ago Bruno g 1 -
0
votes1
answer83
viewsComplete values in a table, with values of the table itself?
I have the table data ativo valor ajuste arquivo 17/07/2020 teste1 4,35 nan 9032800000190015197.txt 16/07/2020 teste1 nan nan 9032800000190015197.txt 15/07/2020 teste1 3,12 nan…
-
0
votes1
answer150
viewsPostgresql: Select between dates + time
Good morning. In the movement table, I have, among others, the date and time fields. I need to select between the chosen date and the following day (Ex.: between 09/11/2020 and 09/12/2020). I need…
-
0
votes1
answer493
viewsQuery using Sequelize resulting in "column "id" does not exist" error
I am testing the REST API I am developing. I am using Sequelize and Postgresql. In the API there is the table users with the following fields: user_id user_nickname user_fullname user_password…
-
0
votes0
answers37
viewsCreate temporary table with another table structure while maintaining the primary key constraints
I am layman still in postgresql and would like someone’s help. I created a temporary table (as mentioned in the postgresql manual): CREATE TEMP TABLE IF NOT EXISTS s_agendatemp (like s_agendamento…
-
0
votes0
answers25
viewsPostgresql | Search with aggregation
I’m beating myself up to bring in the sales number. I tried to make a Join of the tables, I studied what I needed and I used a Count, but it did not work well in the aggregation part. Code used:…
postgresqlasked 4 years, 2 months ago Marcel Gomes 1 -
0
votes0
answers66
viewsProblems performing Postgresql Store
I’m having trouble performing the Store from a dump. The scenario is as follows: I am migrating from a GCP environment to AWS, and at this time I am working on the bank migration. A partner dumped…
-
0
votes0
answers233
viewsPostgres Pl syntax (syntax error at or near "integer")
I’m having trouble making a Pl in Postgres, I don’t know where I’m going wrong, can help me... THE TENACIOUS: do $$ declare id_cir integer; begin -- ERROR: syntax error at or near "integer" (SELECT…
-
0
votes1
answer44
viewsERROR: table name "mytableteste" specified more than Once
to try to do this query to "shuffle" the table data. This same query worked in mysql, but not in postgresql. always get this error [Code: 0, SQL State: 42712] ERROR: table name "mytableteste"…
-
0
votes0
answers25
viewsFormat data from the same person in array. POSTGRES
I have an API that returns values to be plotted on a given graph Dashboard. However, this data needs to be formatted to fit the syntax of Charts.js. The consultation I’m doing is as follows: SELECT…
-
0
votes0
answers34
viewsPostgres BLOB binary data return error for PHP + HTML
I am running in HTML with PHP an ERP Project that via XAMPP the file Buscacurriculum.php will bring on screen the image and data of the employee. Mesangem: Fatal error: Uncaught Error: Call to a…
-
0
votes1
answer170
viewsDoubt with Postgresql (Sum & Count)
Personal beauty? I’m studying SQL with Postgres and I’ve been doing well but I have an exercise to do which has swayed my head and I can not solve, and wanted you to help me not only by showing me…
-
0
votes0
answers186
viewsHow to install postgresql and pdAdmin4 in Pop! _OS (Linux)?
I’m trying to install postgresql and pgAdmin4 in Pop! _OS (based on Ubuntu) For this, I followed more or less the steps of this link: https://wiki.postgresql.org/wiki/Apt sudo apt-get install curl…
-
0
votes0
answers32
viewsHow to count items within a Sequelize association
I have in my database a table called Chefs, and another table Recipes receiving a foreign key called chef_id. Using Sequelize I built in my Controller a code that returns the data of chefs together…
-
0
votes0
answers21
viewsUsing "json_populate_recordset" in Postgre in fields other than json x table input
I have a proc where you have to input the JSON file and insert it into a temp table(_test). resultTeste := (select dados ->'Documento'->'Apolice' from _teste as result); INSERT INTO…
-
0
votes1
answer63
viewsHow to select from 2 id to bring Different Name
I’m having trouble making a SELECT on Postgres, as follows. Tabela -> Pessoa In this table, are stored data of Customers, suppliers, Exporters, Manufacturer, There is no table for each type of…
-
0
votes1
answer27
viewsIt is possible to create a Function that takes as parameter a JSON and goes through this JSON saving the data in a table, but filtering
It is possible to create a Function that takes as parameter a JSON and goes through this JSON saving the data in a table, but filtering the Json. Today is inserting direct json without filter.…
-
0
votes0
answers110
viewsHow can I correct the error in the query? [URI 2992 Higher Average Wage Divisions]
25% URI error. Why is the query not ordering? My query: select distinct on (de.nome) de.nome as name_dep, di.nome as name_div, coalesce(round(avg(ve.valor), 2) , 0) as avg_salary from departamento…
-
0
votes0
answers56
viewsHow to create a table with Crosstab in Postgresql?
I have a table tbexame and I want to create another one from a Crosstab, while studying I did the installation of the extension but I am not able to create a select so as to leave the result as…
-
0
votes0
answers31
viewsReturn group of objects by referencing the item in the postgres array field
I need a collection of objects having as reference the items of an array field in postgres, duplicating the person in the relationships she participates in. I am using Rails 6 and created the field…
array postgresql ruby-on-rails ruby active-recordasked 3 years, 12 months ago Carlos Fagiani Jr 160 -
0
votes0
answers25
viewsDoubt to make consultation with period of days
Below I have the statement of an exercise and my query. In case I am not able to implement the part of the last 30 days. I did some research and tested some things on forums, but nothing worked.…
postgresqlasked 3 years, 11 months ago Vera 1 -
0
votes0
answers41
viewsWhat is the best way to perform a dependent insertion of another entry into the database using Typeorm?
The entities involved are the following (cardinality Onetoone) User import { Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from "typeorm"; import Profile from "./Profile"; @Entity()…
-
0
votes0
answers29
viewsON DELETE SET DEFAULT does not work in Postgresql?
I’m trying to leave the value default 'SEM CURSO' in the student table when the course is deleted, but the way I am doing the value of the foreign key is not getting default and yes NULL. I am doing…
-
0
votes0
answers11
viewsProblems with ADMINER/Postgres
I’m using Docker to use Adminer and Postgres together. However, Adminer is rejecting my password that I put in Postgres, I did not understand very well the reason, since I reviewed the Docker code…
-
0
votes1
answer64
viewsCrossing a primary key with 2 foreign keys from the same table?
I was studying some SQL and came across the following problem: I have 2 tables one called Order and another Locations, follow the fields below: ORDER id | data_creation | id_origin | id_destination…
-
0
votes0
answers65
viewsConnection with two banks in c#
I need to connect to two types of databases, namely: Oracle and Postegre. I need to go to Oracle, generate a spool with some queries and upload this spool in Postegre. Is it possible to do this in…
-
0
votes1
answer33
viewsUPDATE WITH CASE DOESN’T WORK
I am working with a bunch of data (Postgres) on vestibular and I was looking to do an update joining two tables and using UPDATE CASE WHEN THEN. I was relating the two tables through their ids and…
-
0
votes0
answers76
viewsHeroku Postgresql - Error Status 500 in second query
I created a Node REST API that requests a Postgresql in Heroku. I use Postman to test the requests. It is working ok on the first request (Status: 200). Follow the Heroku log: But when I try to do…
-
0
votes1
answer86
viewsError while compiling SPRING BOOT application
I am trying to compile a java application and is giving this error: restartedMain] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Unable to create…
-
0
votes1
answer27
viewsSelect with Null Field
I’m doing a survey in a student database, and I started having the following problem: Every time a student fails to fill in the "address" field, even though he has all the other data in the table,…
-
0
votes1
answer59
viewsI would like your opinion about an Entity-Relationship Diagram of a POSTGRESQL script
I am doing a work of the college whose goal is to make a database of a particular library and to elaborate an entity-relationship diagram of it , I made the script in postgresql but I have a lot of…
-
0
votes1
answer49
viewsError when reading some words using percentage wildcard character (%)
Hello. I’m making some queries to the database that uses the PDO. When I make the appointment without the % at the beginning of the condition, the results return correctly. Ex.: $localizacoes =…
-
0
votes0
answers19
viewsLimit access to objects in Postgres
I created a user in postgres so that a certain employee can run only one view available in the bank. I used the following query s: CREATE ROLE LOGIN_FUNCIONARIO WITH LOGIN PASSWORD '999999'…
-
0
votes1
answer91
viewsExpress runs but does not work. JS Node
Good afternoon everyone, I’m having a little problem with the server express in a Node JS application with typescript, typeorm and postgres SQL where when executing the command npm run dev the…
-
0
votes0
answers40
viewsType Orm Relations between entities does not bring the data
My question is how the typeorm brings data from your relationships. const user = await this.userRepository.findOne({ where: { id }, relations: ['userAddress', 'emails', 'phone_numbers', 'person',…