2830
English speaking PostgreSQL public chat. This group is for discussions on PostgreSQL-related topics and strives to provide best-effort support as well.
If your software does not implement safeguards against SQL injection, postgresql will happily eat and execute whatever it was given as a query
Читать полностью…
I suggest you look at the release notes for all of the versions in between and verify if there are any changes of note
Читать полностью…
Upgrading from 13.12 to 13.19
Will there be any issue if I do direct upgrade in application end ?
So you're calling
https://peps.python.org/pep-0249/#fetchall
?
Then it's what it says there:a sequence of sequences (e.g. a list of tuples)
The question is: returns *where*? Perl? Python? GO? Java?
What you show looks like the result of fetchall_arrayref() or something similar.
Hi
Postgre return all data like this: [(-1002438998547,)]
Yes? or im dead wrog?
In your exact situation, in my case I just collected users and then did a mass update once I reached several hundreds or a certain time with no updates
Читать полностью…
Hi can anyone help me with the online coding test
Читать полностью…
Correct.
I picture this like this: Exclusive Locks lead to a kind of hour glass effect to the otherwise parallel locking queue:```||||||||
||||||||
\ /
\ /
\ /
|
/ \
/ \
```
so since PID_1 is doing accesssharelock and this conflict with TRUNCATE (EXCLUSIVELOCK) - it will wait for the PID_1 to finish and only then TRUNCATE will begin?
Читать полностью…
i have a PID_1 which is doing AccessShareLock on table
and then there's another PID_2 that is doing AccessExclusiveLock (truncate) on the same table.
does PID_2 needs to wait for PID_1 to finish first? hope someone can explain me how the locks works
I guess @Tipstertipss means CVE-2025-1094
Be aware that there will be another release this Thursday, you should wait for that. Apart from that, I'd not expect any issues, but you should of course stage the upgrade (i.e., don't upgrade PROD straight away).
You might be interested in https://www.postgresql.org/docs/current/runtime-config-logging.html#GUC-LOG-CONNECTIONS
Читать полностью…
You're doing something wrong probably with your joins, or storage
Читать полностью…
It could cause a slot to be dropped if the WAL data exceeds the allowed limit.
Читать полностью…
hello, I create physical replication slot and it immediately dissappears, why it is happening
Читать полностью…
But I had millions of stored users, so it was impractical to run on every message anywau
Читать полностью…
Hi, sorry if this question might seem stupid, and sorry for this wall of text, but I have this question:
having these tables (which represent the state of Telegram chats/users and their usernames, from the perspective of a bot):
CREATE TABLE IF NOT EXISTS users (
user_id BIGINT PRIMARY KEY,
first_name TEXT NOT NULL,
last_name TEXT
);
CREATE TABLE IF NOT EXISTS chats (
chat_id BIGINT PRIMARY KEY
-- other fields...
);
CREATE TABLE IF NOT EXISTS usernames (
username VARCHAR(32) COLLATE case_insensitive UNIQUE,
user_id BIGINT UNIQUE,
chat_id BIGINT UNIQUE,
FOREIGN KEY(user_id) REFERENCES users(user_id),
FOREIGN KEY(chat_id) REFERENCES chats(chat_id),
CHECK((user_id IS NULL) != (chat_id IS NULL))
);
CREATE OR REPLACE PROCEDURE update_username(n_username VARCHAR(32), u_user_id BIGINT, u_chat_id BIGINT) AS $$
BEGIN
IF (u_user_id IS NULL) = (u_chat_id IS NULL) THEN
RAISE EXCEPTION 'Cannot both set user_id and chat_id (or neither)';
END IF;
DELETE FROM usernames
WHERE (user_id = u_user_id) OR (chat_id = u_chat_id);
IF n_username IS NOT NULL THEN
INSERT INTO usernames(username, user_id, chat_id)
VALUES (n_username, u_user_id, u_chat_id)
ON CONFLICT (username) DO UPDATE SET user_id = u_user_id, chat_id = u_chat_id;
END IF;
END;
$$ LANGUAGE plpgsql;
Can lead to .... interesting times ... ask me how I know ;-)
Читать полностью…
Works that way in most of the reliable rdbms. You are probably reading from table or updating it so modification to it's structure has to wait.
Читать полностью…
Hi everyone, i hope you have a good day!
İ have one difficulty, i need to show all users and roles and them all permission for all database in server in table based.
Result must to be like this:
User1 db_A table_example select,update
User1 db_B table_example2 select
User2 db_A table_example select
User2 db_B table_example2 select,update