Questions tagged as 'postgresql'

1
answer

Can you identify if a PostgreSQL command can crash before it runs?

Sometimes I need to insert a field or an index or make some more critical modification and often ask everyone to leave the base before I execute the command. This command on my machine even with the application executes normally, but when I r...
asked by 02.05.2018 / 17:40
1
answer

I'm having some problems with GROUP BY

I'm having a hard time putting together a select with GROUP BY . What I want to do is this: I have three tables: bicos idbico, idempresa, idbomba abastecimentos idabastec, idbico, idempresa, valora...
asked by 18.05.2018 / 21:20
1
answer

Update a query in installment form

Good afternoon, today a small question has arisen. Somewhere in my code I have a query to do an update. The function is as follows: function updateUser(user_id, params) { const query = 'UPDATE users SET user_name...
asked by 12.04.2018 / 18:30
1
answer

PostgreSQL query bringing more results than expected

Hello, I have a situation in a system where I need to find out which student enrollments are related to a tutor in a class. The tables I have are: matricula containing foreign key with student (mat_aln_id) and with class (mat_tur_...
asked by 10.04.2018 / 15:38
1
answer

Force PostgreSQL to use an index, how?

Is there a way to force PostgreSQL to use a specific index? I have two equal tables (different servers, of course), with the same indexes created in each one, however, on one server the index is used and the other is not. I need to get the...
asked by 06.03.2018 / 20:36
1
answer

"Could not find driver" when setting application root page

When running the command php -S localhost:8080 -t public The error above is triggered when I try to make a connection with postgres. Other applications can access normally when accessed by the url of the local server. All extensions and m...
asked by 01.03.2018 / 14:02
1
answer

Class diagram x Database

I have a class diagram and would like to know how to build the database. Here's the scenario: With the classes below I have a Demand that has a requestor and an analyst, next to each of the classes should I have a list of demands? In th...
asked by 17.02.2018 / 21:56
1
answer

Postgresql Database

How do I make a select with sum and inner join to add a value x between 3 tables. A query return to the lowest possible number of results. create table credit_card ( credit_card_id int primary key, nome varchar...
asked by 28.01.2018 / 10:34
1
answer

Error removing table in PostgreSQL

I'm trying to install and configure PostgreSQL on my machine, but I'm having some questions and some problems. I followed the following steps of the installation tutorial on the official site . I'm using Linux Mint Cinnamon 18.2. Here a...
asked by 14.12.2017 / 04:44
2
answers

PostgreSQL Error: "ERROR: there is no unique constraint matching given keys for referenced table" address ""

I created the Address and Client table, as follows sql: CREATE TABLE ENDERECO( Logradouro VARCHAR (50) NOT NULL, CEP VARCHAR(50) NOT NULL, Numero INT NOT NULL, Complemento VARCHAR(50), Cidade VARCHAR (50) NOT NULL, Bairro VARCHAR (50) NOT NULL...
asked by 13.12.2017 / 03:53