diff options
| author | Peter Eisentraut | 2022-11-13 07:11:17 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2022-11-13 07:12:37 +0000 |
| commit | afbfc02983f86c4d71825efa6befd547fe81a926 (patch) | |
| tree | 0cff343b85d5c01fb022e0433d89f5d350609fd4 /src/backend/commands/trigger.c | |
| parent | b4b7ce8061d34cea2b4915c41403b2a74d5fde0e (diff) | |
Refactor ownercheck functions
Instead of dozens of mostly-duplicate pg_foo_ownercheck() functions,
write one common function object_ownercheck() that can handle almost
all of them. We already have all the information we need, such as
which system catalog corresponds to which catalog table and which
column is the owner column.
Reviewed-by: Corey Huinker <[email protected]>
Reviewed-by: Antonin Houska <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/[email protected]
Diffstat (limited to 'src/backend/commands/trigger.c')
| -rw-r--r-- | src/backend/commands/trigger.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index e64145e710c..df408092820 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -1445,7 +1445,7 @@ RangeVarCallbackForRenameTrigger(const RangeVar *rv, Oid relid, Oid oldrelid, errdetail_relkind_not_supported(form->relkind))); /* you must own the table to rename one of its triggers */ - if (!pg_class_ownercheck(relid, GetUserId())) + if (!object_ownercheck(RelationRelationId, relid, GetUserId())) aclcheck_error(ACLCHECK_NOT_OWNER, get_relkind_objtype(get_rel_relkind(relid)), rv->relname); if (!allowSystemTableMods && IsSystemClass(relid, form)) ereport(ERROR, |
