Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>, Ted Yu <yuzhihong@gmail.com>, Pavel Luzanov <p.luzanov@postgrespro.ru>, Justin Pryzby <pryzby@telsasoft.com>, pgsql-hackers@postgresql.org
Date: 2023-06-20T22:53:52Z
Lists: pgsql-hackers
On Tue, Jun 20, 2023 at 11:43:05AM -0700, Jeff Davis wrote: > 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. Yes, that feels a bit inconsistent to only check the partitioned table in RangeVarCallbackForReindexIndex() and let all the partitions process as a user may not have the permissions to work on the partitions themselves. We'd need something close to expand_vacuum_rel() for this work. I am not sure that this level of change is required, TBH, still it could be discussed for v17~. > 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. I am not sure to understand this last sentence. REINDEX on a partitioned table builds a list of the indexes to work on in the first transaction processing the command in ReindexPartitions(), and there is no need to process partitioned indexes as these have no storage, so your suggestion is a no-op? -- Michael
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