diff options
author | Jeff Davis <jdavis@postgresql.org> | 2023-01-13 15:32:37 -0800 |
---|---|---|
committer | Jeff Davis <jdavis@postgresql.org> | 2023-01-14 00:16:23 -0800 |
commit | ff9618e82a466fc9c635f9f087776e57b21e4f14 (patch) | |
tree | 667ee5aece95c24ff098be9e39f67aa9df461d2d /src/include/commands/tablecmds.h | |
parent | ff23b592ad6621563d3128b26860bcb41daf9542 (diff) |
Fix MAINTAIN privileges for toast tables and partitions.
Commit 60684dd8 left loose ends when it came to maintaining toast
tables or partitions.
For toast tables, simply skip the privilege check if the toast table
is an indirect target of the maintenance command, because the main
table privileges have already been checked.
For partitions, allow the maintenance command if the user has the
MAINTAIN privilege on the partition or any parent.
Also make CLUSTER emit "skipping" messages when the user doesn't have
privileges, similar to VACUUM.
Author: Nathan Bossart
Reported-by: Pavel Luzanov
Reviewed-by: Pavel Luzanov, Ted Yu
Discussion: https://postgr.es/m/20230113231339.GA2422750@nathanxps13
Diffstat (limited to 'src/include/commands/tablecmds.h')
-rw-r--r-- | src/include/commands/tablecmds.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h index 2e717fa815e..e7c2b91a583 100644 --- a/src/include/commands/tablecmds.h +++ b/src/include/commands/tablecmds.h @@ -98,6 +98,7 @@ extern void AtEOSubXact_on_commit_actions(bool isCommit, extern void RangeVarCallbackMaintainsTable(const RangeVar *relation, Oid relId, Oid oldRelId, void *arg); +extern bool has_partition_ancestor_privs(Oid relid, Oid userid, AclMode acl); extern void RangeVarCallbackOwnsRelation(const RangeVar *relation, Oid relId, Oid oldRelId, void *arg); |