diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2012-06-15 22:55:03 +0300 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2012-06-15 22:55:03 +0300 |
commit | 15b1918e7d3532f0e4ec3455ae6ce45fae09c86f (patch) | |
tree | 659b8a57116719720c1b59d7d6ad507d72d3c748 /src/backend/commands/opclasscmds.c | |
parent | d933092e0ab55ed95615977e50963f969ac9793d (diff) | |
download | postgresql-15b1918e7d3532f0e4ec3455ae6ce45fae09c86f.tar.gz postgresql-15b1918e7d3532f0e4ec3455ae6ce45fae09c86f.zip |
Improve reporting of permission errors for array types
Because permissions are assigned to element types, not array types,
complaining about permission denied on an array type would be
misleading to users. So adjust the reporting to refer to the element
type instead.
In order not to duplicate the required logic in two dozen places,
refactor the permission denied reporting for types a bit.
pointed out by Yeb Havinga during the review of the type privilege
feature
Diffstat (limited to 'src/backend/commands/opclasscmds.c')
-rw-r--r-- | src/backend/commands/opclasscmds.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c index 460b1d9ae28..f5642447f12 100644 --- a/src/backend/commands/opclasscmds.c +++ b/src/backend/commands/opclasscmds.c @@ -414,8 +414,7 @@ DefineOpClass(CreateOpClassStmt *stmt) /* XXX this is unnecessary given the superuser check above */ /* Check we have ownership of the datatype */ if (!pg_type_ownercheck(typeoid, GetUserId())) - aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_TYPE, - format_type_be(typeoid)); + aclcheck_error_type(ACLCHECK_NOT_OWNER, typeoid); #endif /* @@ -565,8 +564,7 @@ DefineOpClass(CreateOpClassStmt *stmt) /* XXX this is unnecessary given the superuser check above */ /* Check we have ownership of the datatype */ if (!pg_type_ownercheck(storageoid, GetUserId())) - aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_TYPE, - format_type_be(storageoid)); + aclcheck_error_type(ACLCHECK_NOT_OWNER, storageoid); #endif break; default: |