aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/operatorcmds.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-11-13 08:11:17 +0100
committerPeter Eisentraut <peter@eisentraut.org>2022-11-13 08:12:37 +0100
commitafbfc02983f86c4d71825efa6befd547fe81a926 (patch)
tree0cff343b85d5c01fb022e0433d89f5d350609fd4 /src/backend/commands/operatorcmds.c
parentb4b7ce8061d34cea2b4915c41403b2a74d5fde0e (diff)
downloadpostgresql-afbfc02983f86c4d71825efa6befd547fe81a926.tar.gz
postgresql-afbfc02983f86c4d71825efa6befd547fe81a926.zip
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 <corey.huinker@gmail.com> Reviewed-by: Antonin Houska <ah@cybertec.at> Discussion: https://www.postgresql.org/message-id/flat/95c30f96-4060-2f48-98b5-a4392d3b6066@enterprisedb.com
Diffstat (limited to 'src/backend/commands/operatorcmds.c')
-rw-r--r--src/backend/commands/operatorcmds.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/operatorcmds.c b/src/backend/commands/operatorcmds.c
index a5924d7d564..a2d7ae89d74 100644
--- a/src/backend/commands/operatorcmds.c
+++ b/src/backend/commands/operatorcmds.c
@@ -481,7 +481,7 @@ AlterOperator(AlterOperatorStmt *stmt)
}
/* Check permissions. Must be owner. */
- if (!pg_oper_ownercheck(oprId, GetUserId()))
+ if (!object_ownercheck(OperatorRelationId, oprId, GetUserId()))
aclcheck_error(ACLCHECK_NOT_OWNER, OBJECT_OPERATOR,
NameStr(oprForm->oprname));