Unify some internal error message wordings

This commit is contained in:
Peter Eisentraut 2022-11-08 18:45:29 +01:00
parent 042c9091f0
commit b5621b66e7
4 changed files with 14 additions and 14 deletions

View File

@ -1245,7 +1245,7 @@ SetDefaultACL(InternalDefaultACL *iacls)
break; break;
default: default:
elog(ERROR, "unrecognized objtype: %d", elog(ERROR, "unrecognized object type: %d",
(int) iacls->objtype); (int) iacls->objtype);
objtype = 0; /* keep compiler quiet */ objtype = 0; /* keep compiler quiet */
break; break;
@ -3590,7 +3590,7 @@ aclcheck_error(AclResult aclerr, ObjectType objtype,
case OBJECT_TSPARSER: case OBJECT_TSPARSER:
case OBJECT_TSTEMPLATE: case OBJECT_TSTEMPLATE:
case OBJECT_USER_MAPPING: case OBJECT_USER_MAPPING:
elog(ERROR, "unsupported object type %d", objtype); elog(ERROR, "unsupported object type: %d", objtype);
} }
ereport(ERROR, ereport(ERROR,
@ -3728,7 +3728,7 @@ aclcheck_error(AclResult aclerr, ObjectType objtype,
case OBJECT_TSPARSER: case OBJECT_TSPARSER:
case OBJECT_TSTEMPLATE: case OBJECT_TSTEMPLATE:
case OBJECT_USER_MAPPING: case OBJECT_USER_MAPPING:
elog(ERROR, "unsupported object type %d", objtype); elog(ERROR, "unsupported object type: %d", objtype);
} }
ereport(ERROR, ereport(ERROR,
@ -3828,7 +3828,7 @@ pg_aclmask(ObjectType objtype, Oid table_oid, AttrNumber attnum, Oid roleid,
case OBJECT_TYPE: case OBJECT_TYPE:
return pg_type_aclmask(table_oid, roleid, mask, how); return pg_type_aclmask(table_oid, roleid, mask, how);
default: default:
elog(ERROR, "unrecognized objtype: %d", elog(ERROR, "unrecognized object type: %d",
(int) objtype); (int) objtype);
/* not reached, but keep compiler quiet */ /* not reached, but keep compiler quiet */
return ACL_NO_RIGHTS; return ACL_NO_RIGHTS;

View File

@ -1164,7 +1164,7 @@ get_object_address(ObjectType objtype, Node *object,
address.objectSubId = 0; address.objectSubId = 0;
break; break;
default: default:
elog(ERROR, "unrecognized objtype: %d", (int) objtype); elog(ERROR, "unrecognized object type: %d", (int) objtype);
/* placate compiler, in case it thinks elog might return */ /* placate compiler, in case it thinks elog might return */
address.classId = InvalidOid; address.classId = InvalidOid;
address.objectId = InvalidOid; address.objectId = InvalidOid;
@ -1355,7 +1355,7 @@ get_object_address_unqualified(ObjectType objtype,
address.objectSubId = 0; address.objectSubId = 0;
break; break;
default: default:
elog(ERROR, "unrecognized objtype: %d", (int) objtype); elog(ERROR, "unrecognized object type: %d", (int) objtype);
/* placate compiler, which doesn't know elog won't return */ /* placate compiler, which doesn't know elog won't return */
address.classId = InvalidOid; address.classId = InvalidOid;
address.objectId = InvalidOid; address.objectId = InvalidOid;
@ -1432,7 +1432,7 @@ get_relation_by_qualified_name(ObjectType objtype, List *object,
RelationGetRelationName(relation)))); RelationGetRelationName(relation))));
break; break;
default: default:
elog(ERROR, "unrecognized objtype: %d", (int) objtype); elog(ERROR, "unrecognized object type: %d", (int) objtype);
break; break;
} }
@ -1508,7 +1508,7 @@ get_object_address_relobject(ObjectType objtype, List *object,
address.objectSubId = 0; address.objectSubId = 0;
break; break;
default: default:
elog(ERROR, "unrecognized objtype: %d", (int) objtype); elog(ERROR, "unrecognized object type: %d", (int) objtype);
} }
/* Avoid relcache leak when object not found. */ /* Avoid relcache leak when object not found. */
@ -1700,7 +1700,7 @@ get_object_address_opcf(ObjectType objtype, List *object, bool missing_ok)
address.objectSubId = 0; address.objectSubId = 0;
break; break;
default: default:
elog(ERROR, "unrecognized objtype: %d", (int) objtype); elog(ERROR, "unrecognized object type: %d", (int) objtype);
/* placate compiler, which doesn't know elog won't return */ /* placate compiler, which doesn't know elog won't return */
address.classId = InvalidOid; address.classId = InvalidOid;
address.objectId = InvalidOid; address.objectId = InvalidOid;
@ -1818,7 +1818,7 @@ get_object_address_opf_member(ObjectType objtype,
} }
break; break;
default: default:
elog(ERROR, "unrecognized objtype: %d", (int) objtype); elog(ERROR, "unrecognized object type: %d", (int) objtype);
} }
return address; return address;

View File

@ -99,7 +99,7 @@ report_name_conflict(Oid classId, const char *name)
msgfmt = gettext_noop("subscription \"%s\" already exists"); msgfmt = gettext_noop("subscription \"%s\" already exists");
break; break;
default: default:
elog(ERROR, "unsupported object class %u", classId); elog(ERROR, "unsupported object class: %u", classId);
break; break;
} }
@ -142,7 +142,7 @@ report_namespace_conflict(Oid classId, const char *name, Oid nspOid)
msgfmt = gettext_noop("text search configuration \"%s\" already exists in schema \"%s\""); msgfmt = gettext_noop("text search configuration \"%s\" already exists in schema \"%s\"");
break; break;
default: default:
elog(ERROR, "unsupported object class %u", classId); elog(ERROR, "unsupported object class: %u", classId);
break; break;
} }

View File

@ -807,7 +807,7 @@ acldefault(ObjectType objtype, Oid ownerId)
owner_default = ACL_ALL_RIGHTS_PARAMETER_ACL; owner_default = ACL_ALL_RIGHTS_PARAMETER_ACL;
break; break;
default: default:
elog(ERROR, "unrecognized objtype: %d", (int) objtype); elog(ERROR, "unrecognized object type: %d", (int) objtype);
world_default = ACL_NO_RIGHTS; /* keep compiler quiet */ world_default = ACL_NO_RIGHTS; /* keep compiler quiet */
owner_default = ACL_NO_RIGHTS; owner_default = ACL_NO_RIGHTS;
break; break;
@ -904,7 +904,7 @@ acldefault_sql(PG_FUNCTION_ARGS)
objtype = OBJECT_TYPE; objtype = OBJECT_TYPE;
break; break;
default: default:
elog(ERROR, "unrecognized objtype abbreviation: %c", objtypec); elog(ERROR, "unrecognized object type abbreviation: %c", objtypec);
} }
PG_RETURN_ACL_P(acldefault(objtype, owner)); PG_RETURN_ACL_P(acldefault(objtype, owner));