Questions tagged [PostgreSQL] (1722)

0
answer

How to migrate to node-pg-migrate using specific path to migrations dir?

Hello! I want to use this extension to migrate the database. https://salsita.github.io/node-pg-migrate/#/cli The Configuration item identifies the list of available arguments, including: migrations-dir I need to migrate were rolled not from ./migrations, and of ./src/migrations tried npm run migrate up-m='src/migration...
cullen_Nitzsche asked April 19th 20 at 12:47
1
answer

Dynamic query postgres?

Good afternoon/morning/night! I have a function: async function get() { // Do request const rows = await pg.query(` SELECT * FROM post `) } I want to call this same function but with suffix _all, tobish post_all is a new sign Is it possible somehow to make the request, not to use js and not duplicating queries? Say 1 t...
barrett_Cruickshank60 asked April 19th 20 at 12:46
2
answers

How to find the cause of "Exception: transaction idle timeout" in the application Flask+psycopg2+postgresql+pgbouncer?

There was a problem. Every month the web application was stopped with an error 502. The reason postgresql has stopped processing requests because the limit was exceeded number of connections. The process list showed a bunch of open pending compounds that block some request. Moreover, the request was quite ordinary, which is...
Agustin53 asked April 19th 20 at 12:39
1
answer

How to create a PostgreSQL table function c with the column names as arguments?

Good day to all. There is a team select supplier, car_category, count(car_type) from mytable group by 1,2 order by 1,2; which returns me the desired table supplier | car_category | count ----------+--------------+------- Avis | Compact | 4 Avis | Fullsize | 2 Avis | Hatch | 6 Avis | Intermediate | 4 Avis | Sedan | 6 ...
Neoma22 asked April 19th 20 at 12:39
2
answers

How to log in pgAdmin4?

Set yourself fresh pgAdmin4, entered it, asked for the master password. Then decided to log out, but not finding a special button for that just cleaned cookies. But instead of the expected redirect to the form login I get a 401 Unauthorized. Forms for login anywhere, I even tried all sorts of random /login to drive, but wi...
keeley_Bogan asked April 19th 20 at 12:37
3
answers

Postgresql. User rights superuser. Access control?

Good afternoon. (1)it is Necessary in postgresql to limit access to a particular schema or table. It must be done so that the administrators of the DB, including owning the account superuser had access rights to this schema to read from it, etc., in General any rights she had. Access should only be provided for specific ro...
Willard asked April 19th 20 at 12:34
4
answers

As in PostgreSql to gruppirovanie for null/not_null?

There is then a field, columnName, which can contain either NULL, or some random string. If you write a normal "GROUP BY columnName", then the sample are grouped by each value of columnName that there is almost unique and the meaning of such groupings there. I would like to divide the sample into 2 parts: one where the fiel...
Robert.Schuppe asked April 19th 20 at 12:26
1
answer

As in PostgreSql to correctly set the indexes?

How to set indexes in the database, so as not to hurt performance? Correctly put on a foreign key column? Is it right to put on each column that can participate in the where clause?
herman43 asked April 19th 20 at 12:17
0
answer

How to remove related entities in one query?

Hello, I tried to remove the row from the table patr and the line with a reference key that refers to it here is the table structure Create table part( p_no integer primary key, p_name varchar(20) not null, price integer not null, color varchar(1) not null, weight integer not null ); create table cells( sno integer n...
ken asked April 19th 20 at 12:12
3
answers

What is a good analogue pgAdmin4?

Need a free and fast analogue pgAdmin4. Preferably with hints on the fly. What is better to choose?
Alia_Mayer54 asked April 19th 20 at 12:12