Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Michael Paquier <michael@paquier.xyz>, Ted Yu <yuzhihong@gmail.com>, Pavel Luzanov <p.luzanov@postgrespro.ru>, Justin Pryzby <pryzby@telsasoft.com>, pgsql-hackers@postgresql.org
Date: 2023-06-20T22:52:57Z
Lists: pgsql-hackers
Attachments
- v7-0001-partial-revert-of-ff9618e82a.patch (text/x-diff)
I've attached rebased versions of the remaining two patches. On Tue, Jun 20, 2023 at 11:43:05AM -0700, Jeff Davis wrote: > * REINDEX TABLE applies to all indexes in all partitions, which seems > a bit inconsistent. > > The only behavior I'm worried about is REINDEX. I'm not sure what we > should do about it, or if we even want to do something about it. If we > want REINDEX to fail in this case, we should be sure to check > permissions on everything up-front to avoid doing a lot of work. The > only other option I can think of is to REINDEX only those indexes > declared on the partitioned table (not the individual partitions), > which seems consistent but might be confusing to users. At the moment, I think I'm inclined to call this "existing behavior" since we didn't check privileges for each partition in this case even before MAINTAIN was introduced. IIUC we still process the individual partitions in v15 regardless of whether the calling user owns the partition. However, I do agree that it feels inconsistent. Besides the options you proposed, we might also consider making REINDEX work a bit more like VACUUM and ANALYZE and emit a WARNING for any relations that the user is not permitted to process. But this probably deserves its own thread, and it might even need to wait until v17. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com
Commits
-
Improve privilege documentation for maintenance commands.
- c2122aae636d 16.0 landed
-
Fix cache lookup hazards introduced by ff9618e82a.
- 4dbdb82513b6 16.0 landed
-
Move bool parameter for vacuum_rel() to option bits.
- 5b1a87994312 16.0 landed
-
Fix MAINTAIN privileges for toast tables and partitions.
- ff9618e82a46 16.0 landed
-
Add grantable MAINTAIN privilege and pg_maintain role.
- 60684dd834a2 16.0 landed