]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix come incorrect elog() messages in aclchk.c
authorMichael Paquier <michael@paquier.xyz>
Fri, 23 Dec 2022 01:04:30 +0000 (10:04 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 23 Dec 2022 01:04:30 +0000 (10:04 +0900)
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

src/backend/catalog/aclchk.c

index 5f1726c0957a35cd9995eef878346a45caf5b043..95d85a7e2c959c49afed73abcc3eb011b18e4cab 100644 (file)
@@ -6100,7 +6100,7 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
 
                tuple = SearchSysCache1(FOREIGNSERVEROID, ObjectIdGetDatum(objoid));
                if (!HeapTupleIsValid(tuple))
-                       elog(ERROR, "cache lookup failed for foreign data wrapper %u",
+                       elog(ERROR, "cache lookup failed for foreign server %u",
                                 objoid);
 
                aclDatum = SysCacheGetAttr(FOREIGNSERVEROID, tuple,
@@ -6186,7 +6186,7 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
 
                tuple = SearchSysCache1(NAMESPACEOID, ObjectIdGetDatum(objoid));
                if (!HeapTupleIsValid(tuple))
-                       elog(ERROR, "cache lookup failed for function %u", objoid);
+                       elog(ERROR, "cache lookup failed for schema %u", objoid);
 
                aclDatum = SysCacheGetAttr(NAMESPACEOID, tuple,
                                                                   Anum_pg_namespace_nspacl, &isNull);
@@ -6228,7 +6228,7 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
 
                tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(objoid));
                if (!HeapTupleIsValid(tuple))
-                       elog(ERROR, "cache lookup failed for function %u", objoid);
+                       elog(ERROR, "cache lookup failed for type %u", objoid);
 
                aclDatum = SysCacheGetAttr(TYPEOID, tuple, Anum_pg_type_typacl,
                                                                   &isNull);