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>, Ted Yu <yuzhihong@gmail.com>
Cc: Pavel Luzanov <p.luzanov@postgrespro.ru>, Justin Pryzby <pryzby@telsasoft.com>, pgsql-hackers@postgresql.org
Date: 2023-01-13T19:56:03Z
Lists: pgsql-hackers
On Mon, 2023-01-09 at 14:51 -0800, Nathan Bossart wrote: > On Tue, Jan 03, 2023 at 03:45:49PM -0800, Nathan Bossart wrote: > > I'd like to get this fixed, but I have yet to hear thoughts on the > > suggested approach. I'll proceed with adjusting the tests and > > documentation shortly unless someone objects. > > As promised, here is a new version of the patch with adjusted tests > and > documentation. The current patch doesn't handle the case properly where you have partitions that have toast tables. An easy fix by recursing, but I think we might want to do things differently anyway. I'm hesitant to add an index to pg_class just for the privilege checks on toast tables, and I don't think we need to. Instead, we can just skip the privilege check on a toast table if it's not referenced directly, because we already checked the privileges on the parent, and we still hold the session lock so nothing strange should have happened. I'll look into that, but so far it looks like it should come out cleanly for toast tables. The way you're checking privileges on the partitioned tables is fine. -- Jeff Davis PostgreSQL Contributor Team - AWS
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