postgres.git / summary / log / commit / refs

commit    df6fea51f01d38a427ed7c5d2e13c501f0beb4f0
Author:   Michael Paquier <michael@paquier.xyz>
Date:     Fri Dec 23 01:04:37 2022 +0000
First released in: 16.0, 11.19, 12.14, 13.10, 14.7, 15.2

    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


src/backend/catalog/aclchk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c index d1e252dfdd2..ff6634044c5 100644 --- a/src/backend/catalog/aclchk.c +++ b/src/backend/catalog/aclchk.c @@ -5680,7 +5680,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, @@ -5761,7 +5761,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); @@ -5803,7 +5803,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); [parent: 8cd700cc5a67]