Skip to content

Commit 7445869

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 d572003 commit 7445869

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
@@ -5684,7 +5684,7 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
56845684

56855685
tuple = SearchSysCache1(FOREIGNSERVEROID, ObjectIdGetDatum(objoid));
56865686
if (!HeapTupleIsValid(tuple))
5687-
elog(ERROR, "cache lookup failed for foreign data wrapper %u",
5687+
elog(ERROR, "cache lookup failed for foreign server %u",
56885688
objoid);
56895689

56905690
aclDatum = SysCacheGetAttr(FOREIGNSERVEROID, tuple,
@@ -5765,7 +5765,7 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
57655765

57665766
tuple = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(objoid));
57675767
if (!HeapTupleIsValid(tuple))
5768-
elog(ERROR, "cache lookup failed for function %u", objoid);
5768+
elog(ERROR, "cache lookup failed for schema %u", objoid);
57695769

57705770
aclDatum = SysCacheGetAttr(NAMESPACEOID, tuple,
57715771
Anum_pg_namespace_nspacl, &isNull);
@@ -5807,7 +5807,7 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
58075807

58085808
tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(objoid));
58095809
if (!HeapTupleIsValid(tuple))
5810-
elog(ERROR, "cache lookup failed for function %u", objoid);
5810+
elog(ERROR, "cache lookup failed for type %u", objoid);
58115811

58125812
aclDatum = SysCacheGetAttr(TYPEOID, tuple, Anum_pg_type_typacl,
58135813
&isNull);

0 commit comments

Comments
 (0)