Skip to content

Commit 7ad458e

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 97431d6 commit 7ad458e

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

57535753
tuple = SearchSysCache1(FOREIGNSERVEROID, ObjectIdGetDatum(objoid));
57545754
if (!HeapTupleIsValid(tuple))
5755-
elog(ERROR, "cache lookup failed for foreign data wrapper %u",
5755+
elog(ERROR, "cache lookup failed for foreign server %u",
57565756
objoid);
57575757

57585758
aclDatum = SysCacheGetAttr(FOREIGNSERVEROID, tuple,
@@ -5838,7 +5838,7 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
58385838

58395839
tuple = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(objoid));
58405840
if (!HeapTupleIsValid(tuple))
5841-
elog(ERROR, "cache lookup failed for function %u", objoid);
5841+
elog(ERROR, "cache lookup failed for schema %u", objoid);
58425842

58435843
aclDatum = SysCacheGetAttr(NAMESPACEOID, tuple,
58445844
Anum_pg_namespace_nspacl, &isNull);
@@ -5880,7 +5880,7 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
58805880

58815881
tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(objoid));
58825882
if (!HeapTupleIsValid(tuple))
5883-
elog(ERROR, "cache lookup failed for function %u", objoid);
5883+
elog(ERROR, "cache lookup failed for type %u", objoid);
58845884

58855885
aclDatum = SysCacheGetAttr(TYPEOID, tuple, Anum_pg_type_typacl,
58865886
&isNull);

0 commit comments

Comments
 (0)