mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Replace AclObjectKind with ObjectType
AclObjectKind was basically just another enumeration for object types, and we already have a preferred one for that. It's only used in aclcheck_error. By using ObjectType instead, we can also give some more precise error messages, for example "index" instead of "relation". Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
This commit is contained in:
@ -74,7 +74,7 @@ DefineCollation(ParseState *pstate, List *names, List *parameters, bool if_not_e
|
||||
|
||||
aclresult = pg_namespace_aclcheck(collNamespace, GetUserId(), ACL_CREATE);
|
||||
if (aclresult != ACLCHECK_OK)
|
||||
aclcheck_error(aclresult, ACL_KIND_NAMESPACE,
|
||||
aclcheck_error(aclresult, OBJECT_SCHEMA,
|
||||
get_namespace_name(collNamespace));
|
||||
|
||||
foreach(pl, parameters)
|
||||
@ -278,7 +278,7 @@ AlterCollation(AlterCollationStmt *stmt)
|
||||
collOid = get_collation_oid(stmt->collname, false);
|
||||
|
||||
if (!pg_collation_ownercheck(collOid, GetUserId()))
|
||||
aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_COLLATION,
|
||||
aclcheck_error(ACLCHECK_NOT_OWNER, OBJECT_COLLATION,
|
||||
NameListToString(stmt->collname));
|
||||
|
||||
tup = SearchSysCacheCopy1(COLLOID, ObjectIdGetDatum(collOid));
|
||||
|
Reference in New Issue
Block a user