Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: Nathan Bossart <nathandbossart@gmail.com>, Michael Paquier <michael@paquier.xyz>
Cc: Ted Yu <yuzhihong@gmail.com>, Pavel Luzanov <p.luzanov@postgrespro.ru>, Justin Pryzby <pryzby@telsasoft.com>, pgsql-hackers@postgresql.org
Date: 2023-06-20T18:43:05Z
Lists: pgsql-hackers
On Mon, 2023-06-19 at 14:55 -0700, Nathan Bossart wrote: > I'm hoping to commit 0002 and 0003 by the end of the week so > that these fixes are available in 16beta2. A few observations for the case where a user does have the MAINTAIN privilege on a partitioned table but not the partitions: * they can LOCK TABLE on the partitioned table * ANALYZE works on the inheritance tree but not the individual partitions * CLUSTER and VACUUM are useless because they skip all of the partitions. That's consistent with the purpose of this thread -- to avoid the locking problems trying to support those operations on partitioned tables. * 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. Regards, Jeff Davis
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