Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: Stephen Frost <sfrost@snowman.net>, "Bossart, Nathan"
<bossartn@amazon.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-11-02T17:28:39Z
Lists: pgsql-hackers
Attachments
- pg-checkpoint.diff (text/x-patch) patch
On Mon, 2021-11-01 at 12:50 -0400, Stephen Frost wrote: > All that said, I wonder if we can have our cake and eat it too. I > haven't looked into this at all yet and perhaps it's foolish on its > face, but, could we make CHECKPOINT; basically turn around and just > run > select pg_checkpoint(); with the regular privilege checking > happening? > Then we'd keep the existing syntax working, but if the user is > allowed > to run the command would depend on if they've been GRANT'd EXECUTE > rights on the function or not. Great idea! Patch attached. This feels like a good pattern that we might want to use elsewhere, if the need arises. Regards, Jeff Davis
Commits
-
Add pg_checkpointer predefined role for CHECKPOINT command.
- 4168a4745492 15.0 landed