menu

Recent questions tagged postgresql

1 vote
1 answer
I want to merge two columns into one, how do I do it? And how to combine the values in columns A and B, which have entries in cell A is 1, and in cell B is 2, how to make them appear in the same column, but in different cel ...
by gowwa123
asked Sep 24, 2021
2 votes
1 answer
How do I wrap each json object in an array? Example: sqlfiddle.com/#!17/000c4c/1/0 There is a table with the following rows: | ID | name | age || 773 | Katya | 21 || 828 | Masha | 23 || 999 | Danya | 41 | ...
by Mr-Governor
asked Sep 24, 2021
2 votes
1 answer
How to get the id of the previous record in the sample, which satisfied the condition? Constructive. CREATE TABLE foo (id int, grp bool);INSERT INTO foo VALUES (1, false), (2, true), (3, false), (4, false), (5, true), (6, false), (7, false), (8, false); g ...
by pqgg7nwkd4
asked Sep 24, 2021
1 vote
1 answer
Is the old record not assigned a postgresql value? I have a function create function tr_ar_skl() returns trigger language plpgsqlas$$ begin raise notice 'old: %', old; insert into "arcSklad" (id_skla ...
by rstJkee
asked Sep 24, 2021
5 votes
5 answers
Geo-distributed database/sharding? Colleagues, I want to get a little weird. there is some kind of authentication service. Now the server is exclusively in Europe, there is a desire to drag the second se ...
by MaxDukov
asked Sep 22, 2021
1 vote
1 answer
Grouping in PostgreSQL? There is a table: id| country | salary 1 | sweden | 3000 2 | germany| 3900 3 | sweden | 3500 4 | sweden | 2900 5 | germany| 3300 You need: ...
by dozzzzer
asked Sep 22, 2021
1 vote
1 answer
How to implement map/array_walk on PostgreSQL? The task is this. You need such JSON {"a": 1, "b": 2}, {"a": 10, "b": 20} turn into such a 1, 10 I.e. for each element of the array pull out a value with the key " ...
by BoneFletcher
asked Sep 22, 2021
1 vote
1 answer
Why does ctx.guild.id return None in the query? I'm writing a leaderboard, everything works on sqlite, but on postgres it fails for some reason. I get TypeError: 'NoneType' object is not iterable @client.command(ali ...
by vollchara
asked Sep 22, 2021
1 vote
2 answers
Why does the RIGHT JOIN not work? There is a table of tasks - issue, when you change a field in the issue, this change is recorded in the table change_item, which describes the nature of changes, since i ...
by Mr-Governor
asked Sep 22, 2021
1 vote
1 answer
PostgreSQL creating a single index for multiple columns of the same type? Good afternoon! If you create one index, of the same type for several columns of the same type, it will not affect the search speed when queried for each column, just ...
by P747
asked Sep 21, 2021
1 vote
2 answers
How do I connect to Postgres that has no public access? Good afternoon! There are two servers on Ubuntu 18.04, the first has a public IP and nginx, and the second is a postgres database server and no remote access to it. Yo ...
by Espritto
asked Sep 21, 2021
1 vote
1 answer
How do I write values to a PostgreSQL database? My bot had a sqlite3 database on discord.py due to the fact that hieroku constantly invalidates the database after restarting the bot. I decided to switch to postgresql. ...
by vollchara
asked Sep 21, 2021
1 vote
1 answer
image
Why doesn't postgreSQL work? I used to use sqlite in my "mini project", but it turns out that heroku only accepts postgreSQL. Installed postgres, psycopg2 module. I start it up and get zero reactio ...
by vollchara
asked Sep 20, 2021
1 vote
2 answers
Sorting by earliest occurrence of a string in the query? There is such a query. On the string passed by the user we are looking for something in the database SELECT email FROM users WHERE email ILIKE :query ORDER BY email We ...
by Delgus
asked Sep 20, 2021
1 vote
1 answer
How to transform a table in PostgreSQL? I have a table of this type: +-----------+----------+------------------------+| week_no | ticker | ratio ||-----------+----------+----------------- ...
by HelloDarknessMyOldFried
asked Sep 20, 2021
1 vote
1 answer
How do I check if my IP address is in the range? Hi all. Please help with advice! I have two tables - one has the clients' ip addresses (ip, cust_name), and the other has ip_from, ip_to, country I only need IP addres ...
by Laurchi
asked Sep 20, 2021
1 vote
1 answer
image
No such file or directory in postgreSQL. How do I connect the database normally? I am taking a course on postgreSQL from this tutorial ( https://edu.postgrespro.ru/introbook_v6.pdf ), but when I got to connect the demonstration base (chapter V) when ...
by darkoment
asked Sep 19, 2021
1 vote
1 answer
DDOs postgresql or what is going on? In my docker lies postgres, the default user is disabled, the port remains standard, it crashes from time to time. From the logs I see at first tones of these messages ...
by mashincode
asked Sep 19, 2021
1 vote
1 answer
How to insert a separate Node in an xml field in Postgresql? I have the following table create table xml_test(id serial primary key,user_id integer,xml_test_f xml) Let's say I ran the command insert into xml_test(user_id, xml_te ...
by DennisKingsman
asked Sep 19, 2021
1 vote
1 answer
What is the connection error with the database? Please help me, I got an error connecting Django to Postgres sudo -u postgres psqlcreate database base;create user userwith password 'password';alter role userset clie ...
by MindStorm
asked Sep 19, 2021