Re: Allow non-superuser to cancel superuser tasks.
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Alexander Kukushkin <cyberdemn@gmail.com>, "Andrey M. Borodin" <x4mmm@yandex-team.ru>, Michael Paquier <michael@paquier.xyz>, Kirill Reshke <reshkekirill@gmail.com>, "Leung, Anthony" <antholeu@amazon.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2024-11-26T21:07:24Z
Lists: pgsql-hackers
Attachments
On Tue, Nov 26, 2024 at 12:27:33PM -0500, Andres Freund wrote: > On 2024-11-22 20:44:34 -0600, Nathan Bossart wrote: >> D'oh, I missed that ProcNumber could be used as an index for the >> BackendStatusArray. Is the attached more like what you are imagining? > > Yes. > > I'd probably add two function header comments: > > 1) explicit caution that this is fetching information not from the snapshot > but "live" data > 2) the return value might be out of date, that the procnumber needs to be > valid and that the caller is responsible for permission checking > > I'd also add a comment do the code saying that it's fine to bypass the > changecount mechanism, because we're reading a single 4 byte integer. I've attempted to add all these details in v3. -- nathan
Commits
-
Look up backend type in pg_signal_backend() more cheaply.
- 61171a632d10 18.0 landed
-
Add tap test for pg_signal_autovacuum role
- d2b74882cab8 18.0 landed
-
Introduce pg_signal_autovacuum_worker.
- ccd38024bc3c 18.0 landed
-
Add a slot synchronization function.
- ddd5f4f54a02 17.0 cited
-
Ban role pg_signal_backend from more superuser backend types.
- 3a9b18b30953 17.0 cited