Re: Allow non-superuser to cancel superuser tasks.

2024-04-12 Thread Kirill Reshke
On Thu, 11 Apr 2024 at 16:55, Kirill Reshke wrote: > 7) > > > +# Copyright (c) 2022-2024, PostgreSQL Global Development Group > > [...] > > +# Copyright (c) 2024-2024, PostgreSQL Global Development Group > > > These need to be cleaned up. > > > +# Makefi

Re: Allow non-superuser to cancel superuser tasks.

2024-04-11 Thread Kirill Reshke
On Thu, 11 Apr 2024 at 19:07, Nathan Bossart wrote: > > On Thu, Apr 11, 2024 at 04:55:59PM +0500, Kirill Reshke wrote: > > Posting updated version of this patch with comments above addressed. > > I look for a commitfest entry for this one, but couldn't find it. Would > you

TerminateOtherDBBackends code comments inconsistency.

2024-04-11 Thread Kirill Reshke
Hi hackers! While working on [0] i have noticed this comment in TerminateOtherDBBackends function: /* * Check whether we have the necessary rights to terminate other * sessions. We don't terminate any session until we ensure that we * have rights on all the sessions to be terminated. These

Re: Allow non-superuser to cancel superuser tasks.

2024-04-11 Thread Kirill Reshke
Posting updated version of this patch with comments above addressed. 1) pg_signal_autovacuum -> pg_signal_autovacuum_worker, as there seems to be no objections to that. 2) There are comments on how to write if statement: > In core, do_autovacuum() is only called in a process without > a role

Re: psql: Greatly speed up "\d tablename" when not using regexes

2024-04-10 Thread Kirill Reshke
On Wed, 10 Apr 2024, 23:37 Jelte Fennema-Nio, wrote: > On Wed, 10 Apr 2024 at 20:21, Kirill Reshke > wrote: > > Do we need to force Collaction here like in other branches? > > if (PQserverVersion(conn) >= 12) > >appendPQExpBufferStr(buf, " COLLATE pg_

Re: psql: Greatly speed up "\d tablename" when not using regexes

2024-04-10 Thread Kirill Reshke
Hi > Regex matching is obviously unnecessary when we're looking for an exact > match. This checks for this (common) case and starts using plain > equality in that case. +1 > + appendPQExpBuffer(buf, "(%s OPERATOR(pg_catalog.=) ", namevar); > + appendStringLiteralConn(buf, [2], conn); > +

Re: [PoC/RFC] Multiple passwords, interval expirations

2024-04-10 Thread Kirill Reshke
Hi! I'm interested in this feature presence in the PostgreSQL core. Will try to provide valuable review/comments/suggestions and other help. On Tue, 10 Oct 2023 at 16:17, Gurjeet Singh wrote: > > > On Mon, Oct 9, 2023 at 2:31 AM Gurjeet Singh wrote: > > > > > > Next steps: > > > - Break the

Re: Allow non-superuser to cancel superuser tasks.

2024-04-09 Thread Kirill Reshke
Hi, thanks for looking into this. On Tue, 9 Apr 2024 at 08:53, Michael Paquier wrote: > On Mon, Apr 08, 2024 at 05:42:05PM +, Leung, Anthony wrote: > > Are you suggesting that we check if the backend is B_AUTOVAC in > > pg_cancel/ terminate_backend? That seems a bit unclean to me since > >

Re: Add last_commit_lsn to pg_stat_database

2024-04-08 Thread Kirill Reshke
Hi James, There are some review in the thread that need to be addressed. it seems that we need to mark this entry "Waiting on Author" and move to the next CF [0]. Thanks [0] https://commitfest.postgresql.org/47/4355/ On Sat, 10 Jun 2023 at 05:27, James Coleman wrote: > I've previously noted

Re: CSN snapshots in hot standby

2024-04-04 Thread Kirill Reshke
Hi, On Thu, 4 Apr 2024 at 22:21, Heikki Linnakangas wrote: > You cannot run queries on a Hot Standby server until the standby has > seen a running-xacts record. Furthermore if the subxids cache had > overflowed, you also need to wait for those transactions to finish. That > is usually not a

Re: Allow non-superuser to cancel superuser tasks.

2024-02-27 Thread Kirill Reshke
On Tue, 27 Feb 2024 at 01:22, Kirill Reshke wrote: > > > On Mon, 26 Feb 2024 at 20:10, Nathan Bossart > wrote: > >> On Mon, Feb 26, 2024 at 12:38:40PM +0500, Kirill Reshke wrote: >> > I see 2 possible ways to implement this. The first one is to have hool >> i

Re: Allow non-superuser to cancel superuser tasks.

2024-02-26 Thread Kirill Reshke
On Mon, 26 Feb 2024 at 20:10, Nathan Bossart wrote: > On Mon, Feb 26, 2024 at 12:38:40PM +0500, Kirill Reshke wrote: > > I see 2 possible ways to implement this. The first one is to have hool in > > pg_signal_backend, and define a hook in extension which can do the thing. >

Allow non-superuser to cancel superuser tasks.

2024-02-25 Thread Kirill Reshke
Hi hackers! In our Cloud we have a patch, which allows non-superuser role ('mdb_admin') to do some superuser things. In particular, we have a patch that allows mdb admin to cancel the autovacuum process and some other processes (processes with application_name = 'MDB'), see the attachment. This

Re: Extensible storage manager API - SMGR hook Redux

2023-12-04 Thread Kirill Reshke
On Mon, 4 Dec 2023 at 22:21, Matthias van de Meent < boekewurm+postg...@gmail.com> wrote: > On Mon, 4 Dec 2023 at 17:51, Kirill Reshke wrote: > > > > So, 0002 patch uses the `get_tablespace` function, which searches > Catalog to tablespace SMGR id. I wonder ho

Fwd: Extensible storage manager API - SMGR hook Redux

2023-12-04 Thread Kirill Reshke
Sorry for double-posting, I accidentally replied to Matthias, not the mailing list :( -- Forwarded message - From: Kirill Reshke Date: Mon, 4 Dec 2023 at 19:46 Subject: Re: Extensible storage manager API - SMGR hook Redux To: Matthias van de Meent Hi! On Fri, 30 Jun 2023

Fwd: Annoying corruption in PostgreSQL.

2023-10-27 Thread Kirill Reshke
Sorry, seems that i replied only to Tomas, so forwarding message. -- Forwarded message - From: Kirill Reshke Date: Sat, 28 Oct 2023 at 02:06 Subject: Re: Annoying corruption in PostgreSQL. To: Tomas Vondra Hi Tomas! Thanks for the explanation! 1) 11 to 15. This week

Annoying corruption in PostgreSQL.

2023-10-27 Thread Kirill Reshke
Hi hackers! We run a large amount of PostgreSQL clusters in our production. They differ by versions (we have 11-16 pg), load, amount of data, schema, etc. From time to time, postgresql corruption happens. It says ERROR,XX001,"missing chunk number 0 for toast value 18767319 in

pg_init_privs corruption.

2023-02-17 Thread Kirill Reshke
Hi hackers! Recently we faced a problem with one of our production clusters. Problem was with pg_upgrade, the reason was an invalid pg_dump of cluster schema. in pg_dump sql there was strange records like REVOKE SELECT,INSERT,DELETE,UPDATE ON TABLE *relation* FROM "144841"; but there is no role

Re: Add sub-transaction overflow status in pg_stat_activity

2023-02-08 Thread Kirill Reshke
On Tue, 20 Dec 2022 at 09:23, Dilip Kumar wrote: > > On Tue, Dec 20, 2022 at 2:32 AM Robert Haas wrote: > > > > On Mon, Dec 19, 2022 at 3:48 PM Ted Yu wrote: > > > It seems the comment for `backend_subxact_overflowed` missed a word. > > > > > > Please see the patch. > > > > Committed this fix,

Use fadvise in wal replay

2022-06-21 Thread Kirill Reshke
Hi hackers! Recently we faced a problem with one of our production clusters. We use a cascade replication setup in this cluster, that is: master, standby (r1), and cascade standby (r2). From time to time, the replication lag on r1 used to grow, while on r2 it did not. Analysys showed that r1

Re: Extensible storage manager API - smgr hooks

2022-06-17 Thread Kirill Reshke
Hello Yura and Anastasia. I have tried to implement per-relation SMGR approach, and faced with a serious problem with redo. So, to implement per-relation SMGR feature i have tried to do things similar to custom table AM apporach: that is, we can define our custom SMGR in an extention (which

Re: Slow standby snapshot

2021-05-20 Thread Kirill Reshke
sorry, forgot to add a patch to the letter чт, 20 мая 2021 г. в 13:52, Кирилл Решке : > Hi, > I recently ran into a problem in one of our production postgresql cluster. > I had noticed lock contention on procarray lock on standby, which causes > WAL replay lag growth. > To reproduce this, you