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
-
-2
votes1
answer766
viewsRelational library model, huh?
This model I made this cool or is redundant yet? [Edited] The database has been modified. Can I now have better queries? Here’s how it is now:…
-
-2
votes3
answers793
viewsHow to delete only records from a field of my table in SQL
Good morning, I would need to delete only those registered from a field of my table. In the case I have the product table and in it has the field dtsanitation and in this field had records. I would…
-
-2
votes1
answer186
viewsCheck Array(STRING) in Postgres column
Good afternoon, everyone, I need to UPDATE a table, but for this I need to compare if the values of an ARRAY(STRING) are inside a column of this table, example: UPDATE tabelaTeste SET versao = '2'…
-
-2
votes1
answer791
viewsTo create a Postgresql database using Spring Boot you need to have Postgresql installed?
I’m following a tutorial on how to create a Rest API using Spring Boot. The commands I’m using on application.properties to create the bank are these:…
-
-2
votes1
answer836
viewsPostgresql in the Windows command line - "psql"
Good morning, I’m trying to learn a little postgresql and I see some videos where they use commands with the tag "psql", but I already downloaded postgre and when I give a command with "psql" at the…
postgresqlasked 4 years, 4 months ago eduardo_ehsc 56 -
-2
votes1
answer21
viewsSelect in nested jsonb - postgresql
I had difficulty finding the values on a basis, as all examples cite the same way to find information in simple jsons. But a friend from work passed me and solution and I came to share. the initial…
-
-2
votes1
answer47
viewsSuccessfully recorded bank warning - R
Hello! I am currently recording/updating my tables in the database with the R language: dbWriteTable(con, "tabela",tabela, row.names=FALSE, overwrite = TRUE) This my script that updates the tables…
-
-2
votes2
answers32
viewsSave table field to a php variable
Good afternoon, guys, how are you? I have a basic doubt, but I think you could help me, as I could save the result of a field within a PHP variable? $sql = "SELECT ped_liberado FROM tb_pedido WHERE…
-
-2
votes1
answer41
viewsconnecting AWS RDS postgres with python
I have a database mounting with the postgres engine in the AWS RDS I would like to know how to access it through python import psycopg2 import sys import boto3 ENDPOINT="endpoint na AWS" PORT="5432"…
-
-2
votes2
answers635
viewsUnhandledpromiserejectionwarning: Sequelizeforeignkeyconstrainterror
insert or update on table "appointments" violates foreign key constraint "appointments_user_id_fkey" I have this error in Nodejs when trying to create a new table that has foreign key in Migration,…
-
-2
votes1
answer1268
viewsSQLSTATE[42P01]: Undefined table: 7 ERROR: relation
I have a project where I made some Migrations, but when I did I managed to run the Migrations quietly. I recently formatted my computer, installed Postgressql and did my "Restore" from my DB. In…
-
-2
votes1
answer42
viewsHow to increment primary and foreign keys in Postgresql using SERIAL
I can’t automatically increment primary and foreign keys of my tables using SERIAL, because error happens and always have to enter the key value. create table cliente( cd_cliente serial primary key…
-
-2
votes1
answer360
viewsSequelize error when performing BD registration [Model.hasMany called with Something that’s not a subclass of Sequelize.Model]
I’m doing a Ode project, using sequelize as ORM. I have 4 tables relating [Factor, Subfactor, Obs_factor, Goals], when I will run the create of this error: Error: Factor.hasMany called with…
javascript node.js postgresql relational-model sequelize-jsasked 4 years, 8 months ago Tarcisio pieroni 3 -
-2
votes1
answer621
viewsPostbird - Connection Error
I created a container on Docker with the following command: docker run --name database -e POSTGRES_PASSWORD=senha -p 5432:5432 -d postgres When I try to access via Postbird, I get the following…
-
-2
votes2
answers3952
viewsError Creating bean with name flywayInitializer defined in class path Resource
I am trying to add new fields to my table in my Spring Boot project using Flyway, and I am not getting this error message. 2020-04-29 12:53:36.345 WARN 544 --- [ restartedMain]…
-
-2
votes1
answer95
viewsDjango is not saving users in the database
I’m doing a project with Django and using postgresql as a database. I created an app Accounts for user registration, but is not registered in the database and does not appear in the Django admin…
-
-2
votes1
answer42
viewsHow to extract String from a database query?
I am implementing a query screen, the user will have to enter the name and after the fields below will have to be filled in. My question is how to perform the consultation? I tried to make Select…
-
-2
votes1
answer147
viewsHow to create a function to delete all database records with Postgresql?
I need to create a script to delete all records from my database in all tables, without deleting the tables and restarting the sequence. I know I should use the TRUNCATE or the DELETE. My bank has…
-
-2
votes2
answers88
viewsDjango/Python primary key generator with low collision risk and good performance
GENERATING UNIQUE PRIMARY APPLICATION KEYS I would like to get tips on how to generate primary keys with low risk of collision and that do not reduce the performance of Postgresql operations.…
-
-2
votes2
answers49
viewsHOW TO TREAT EMPTY VALUES IN SEVERAL COLUMNS?
I have a TB that has 15 telephone columns, where several rows are empty. I need to turn these 15 columns into only one. Using UNION ALL and putting a condition in WHERE to get rid of the empty…
-
-2
votes2
answers35
viewsProblems running the DDL on a Rest Api via JPA
When I go to execute I realize this mistake: org.hibernate.tool.schema.spi.Commandacceptanceexception: Error executing DDL "create table tb-product (id int8 not null, name varchar(255), quantity…
-
-2
votes1
answer44
viewsDelay or not sending the data to the back-end, what to do?
I have a ready front-end of a registration form, but they are working as follows: I do all the registration and when clicking on the button it calls the function that takes the values of the fields…
-
-2
votes2
answers27
viewsSQL command works on SQL SHELL, but does not work on Node (pg) (probably something related to accentuation)
DATABASE I have this database: In it I have this table: In it I have this data: NODE const express = require('express'); const app = express(); const cors = require('cors'); // cors config //…
-
-2
votes0
answers16
viewsjsonb_array_length() in subquery with Insert
I have this query where I try to do an Insert through the main query, but I believe that on account of json_array_legth() it does not let me insert presenting the following error: SQL Error [22023]:…
-
-2
votes0
answers15
viewsQuestion about Postgresql 9.5.25 with pgAdmin 3 that comes installed along with it: how to use command line instead of graphical interface?
Use the Postgresql 9.5.25 and along with it comes the pgAdmin 3 installed. However, I don’t want to use the graphical interface of the database. So I go in the same folder as the pgAdmin3.exe is…
-
-3
votes1
answer1463
viewsHow to create Trigger postgre
In relation to the table above, 1) Create a Rigger that for each record inserted in tb_move, the account balance is updated in tb_balance. Remembering that if the launch is of the type C' increases…
-
-3
votes1
answer130
viewspsqlodbc. h:54:23: fatal error: iodbcinst. h: No such file or directory
Error installing postgresql ODBC in Ubuntu 64 How should I proceed ?…
-
-3
votes1
answer163
viewsPostgresql error: org.postgresql.util.Psqlexception: ERROR: portal "C_70" does not exist
We use a Java Web application with Postgres database to generate the Sped files and in the middle of the TXT file generation we are getting the error below. That one portal "C_70" does not…
-
-3
votes1
answer100
viewsDoes anyone know how it is possible in postgresql, I have two tables with column type ARRAY and use WHERE, to select the records by this column?
I have two TABLE . TAB1 and TAB2 TAB1 GROUPS = {11, 15, 13, 20} TAB2 got the spine: REG1 GROUPS = {11, 8, 15} REG2 GROUPS = {21, 5, 7} REG3 GROUPS = {1, 13, 21} Make a SELECT using the table column…
-
-3
votes2
answers39
viewsChange value of FALSE TRUE column
I have a Postgresql database and need to change the table Produto with the column Permite_venda. The items are with FALSE and I need to move on to TRUE How should I do? I list all below: select *…
-
-3
votes0
answers16
viewsView SQL codes previously made in Postgresql
I wanted to view the code made in the Query Editor of the Query Tool in Postgresql. In Mysql, for example, every time it opens, the codes made previously appear, already in Postgre after closing it…
-
-3
votes1
answer14
viewsselect a column in specific or sort table by id, Postgresql JSP and JSTL
Well I have a project with Postgresql, JSP, JSTL and SERVLETS, where on a screen I have a place that updates a product and another place that shows the table of products, the problem is that I do…
-
-3
votes1
answer57
viewsI need to present the product with the highest gross sales
SELECT p.descricao_prod FROM produto p INNER JOIN venda v ON v.cod_prod = p.codigo WHERE p.preco = (SELECT MAX(p.preco) FROM produto p) I tried with this code, but, it only presents me the product…
-
-3
votes1
answer68
viewsHow to unify the results of Count POSTGRES?
Good morning, I need this query to return the unified result, different from what it returns to me, does anyone have any idea how to do this in Postgres?? went until May(May) but continues until the…
-
-4
votes2
answers273
viewsHow to select only people with a first name
I would like to know how to select people who have only their first name, that is, they have no last name. Example: Nome ---------- Leonardo Roberto Ana Júlio Maria Ana Expected result: Ana, Júlio…
-
-5
votes2
answers870
viewsWhat are the differences between a PL/SQL programmer and an Oracle DBA?
Could someone explain to me the differences between the programmer PL/SQL and the DBA Oracle? I know there are many differences, but I’m not sure how to specify them. I have some doubts too... For…
-
-8
votes1
answer878
viewsCheck if value exists before updating
I need to make a query to update a column, but you should only update the column if the data to be updated does not currently exist in that column.
postgresqlasked 9 years, 3 months ago Miguel Lourenço 11