Skip to content

Commit e3897a3

Browse files
committed
Fix come incorrect elog() messages in aclchk.c
Three error strings used with cache lookup failures were referring to incorrect object types for ACL checks: - Schemas - Types - Foreign Servers There errors should never be triggered, but if they do incorrect information would be reported. Author: Justin Pryzby Discussion: https://postgr.es/m/20221222153041.GN1153@telsasoft.com Backpatch-through: 11
1 parent 1a3daa5 commit e3897a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/catalog/aclchk.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6100,7 +6100,7 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
61006100

61016101
tuple = SearchSysCache1(FOREIGNSERVEROID, ObjectIdGetDatum(objoid));
61026102
if (!HeapTupleIsValid(tuple))
6103-
elog(ERROR, "cache lookup failed for foreign data wrapper %u",
6103+
elog(ERROR, "cache lookup failed for foreign server %u",
61046104
objoid);
61056105

61066106
aclDatum = SysCacheGetAttr(FOREIGNSERVEROID, tuple,
@@ -6186,7 +6186,7 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
61866186

61876187
tuple = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(objoid));
61886188
if (!HeapTupleIsValid(tuple))
6189-
elog(ERROR, "cache lookup failed for function %u", objoid);
6189+
elog(ERROR, "cache lookup failed for schema %u", objoid);
61906190

61916191
aclDatum = SysCacheGetAttr(NAMESPACEOID, tuple,
61926192
Anum_pg_namespace_nspacl, &isNull);
@@ -6228,7 +6228,7 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
62286228

62296229
tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(objoid));
62306230
if (!HeapTupleIsValid(tuple))
6231-
elog(ERROR, "cache lookup failed for function %u", objoid);
6231+
elog(ERROR, "cache lookup failed for type %u", objoid);
62326232

62336233
aclDatum = SysCacheGetAttr(TYPEOID, tuple, Anum_pg_type_typacl,
62346234
&isNull);

0 commit comments

Comments
 (0)