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: Ted Yu <yuzhihong@gmail.com>, Pavel Luzanov <p.luzanov@postgrespro.ru>, Justin Pryzby <pryzby@telsasoft.com>, pgsql-hackers@postgresql.org
Date: 2023-01-13T22:56:26Z
Lists: pgsql-hackers
Attachments
- v5-0001-fix-MAINTAIN-privs-for-partitions.patch (text/x-diff)
On Fri, Jan 13, 2023 at 01:30:28PM -0800, Jeff Davis wrote: > If we care about that use case, let's do it right and have forms of > VACUUM/CLUSTER/REINDEX that check permissions on the main table, skip > the work on the main table, and descend directly to the toast tables. > That doesn't seem hard, but it's a separate patch. You may be interested in https://commitfest.postgresql.org/41/4088/. > Right now, we should simply fix the problem. Okay. Here is a new patch set. I've split the partition work out to a separate patch, and I've removed the main relation lookups for TOAST tables in favor of adding a skip_privs flag to vacuum_rel(). The latter patch probably needs some additional commentary and tests, which I'll go ahead and add if we want to proceed with this approach. I'm assuming the session lock should be sufficient for avoiding the case where the TOAST table's OID is reused by the time we get to it, but I'm not sure if it's sufficient to prevent vacuuming if the privileges on the main relation have changed across transactions. Even if it's not, I'm not sure that case is worth worrying about too much. -- 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