Use DEFACLOBJ_ macros in error message instead of hardcoding

This commit is contained in:
Peter Eisentraut 2017-06-14 14:44:24 -04:00
parent 4e88fe8f8f
commit b6966d4627
2 changed files with 10 additions and 5 deletions

View File

@ -1849,8 +1849,13 @@ get_object_address_defacl(List *object, bool missing_ok)
default:
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("unrecognized default ACL object type %c", objtype),
errhint("Valid object types are \"r\", \"S\", \"f\", \"T\" and \"s\".")));
errmsg("unrecognized default ACL object type \"%c\"", objtype),
errhint("Valid object types are \"%c\", \"%c\", \"%c\", \"%c\", \"%c\".",
DEFACLOBJ_RELATION,
DEFACLOBJ_SEQUENCE,
DEFACLOBJ_FUNCTION,
DEFACLOBJ_TYPE,
DEFACLOBJ_NAMESPACE)));
}
/*

View File

@ -274,11 +274,11 @@ WARNING: error for user mapping,{addr_nsp,zwei},{integer}: user mapping for use
WARNING: error for user mapping,{eins,zwei,drei},{}: argument list length must be exactly 1
WARNING: error for user mapping,{eins,zwei,drei},{integer}: user mapping for user "eins" on server "integer" does not exist
WARNING: error for default acl,{eins},{}: argument list length must be exactly 1
WARNING: error for default acl,{eins},{integer}: unrecognized default ACL object type i
WARNING: error for default acl,{eins},{integer}: unrecognized default ACL object type "i"
WARNING: error for default acl,{addr_nsp,zwei},{}: argument list length must be exactly 1
WARNING: error for default acl,{addr_nsp,zwei},{integer}: unrecognized default ACL object type i
WARNING: error for default acl,{addr_nsp,zwei},{integer}: unrecognized default ACL object type "i"
WARNING: error for default acl,{eins,zwei,drei},{}: argument list length must be exactly 1
WARNING: error for default acl,{eins,zwei,drei},{integer}: unrecognized default ACL object type i
WARNING: error for default acl,{eins,zwei,drei},{integer}: unrecognized default ACL object type "i"
WARNING: error for transform,{eins},{}: argument list length must be exactly 1
WARNING: error for transform,{eins},{integer}: type "eins" does not exist
WARNING: error for transform,{addr_nsp,zwei},{}: name list length must be exactly 1