Skip to content

Commit 3d69654

Browse files
michaelpqpull[bot]
authored andcommitted
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 7745370 commit 3d69654

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

43704370
tuple = SearchSysCache1(FOREIGNSERVEROID, ObjectIdGetDatum(objoid));
43714371
if (!HeapTupleIsValid(tuple))
4372-
elog(ERROR, "cache lookup failed for foreign data wrapper %u",
4372+
elog(ERROR, "cache lookup failed for foreign server %u",
43734373
objoid);
43744374

43754375
aclDatum = SysCacheGetAttr(FOREIGNSERVEROID, tuple,
@@ -4455,7 +4455,7 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
44554455

44564456
tuple = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(objoid));
44574457
if (!HeapTupleIsValid(tuple))
4458-
elog(ERROR, "cache lookup failed for function %u", objoid);
4458+
elog(ERROR, "cache lookup failed for schema %u", objoid);
44594459

44604460
aclDatum = SysCacheGetAttr(NAMESPACEOID, tuple,
44614461
Anum_pg_namespace_nspacl, &isNull);
@@ -4497,7 +4497,7 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
44974497

44984498
tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(objoid));
44994499
if (!HeapTupleIsValid(tuple))
4500-
elog(ERROR, "cache lookup failed for function %u", objoid);
4500+
elog(ERROR, "cache lookup failed for type %u", objoid);
45014501

45024502
aclDatum = SysCacheGetAttr(TYPEOID, tuple, Anum_pg_type_typacl,
45034503
&isNull);

0 commit comments

Comments
 (0)