From: Justin Pryzby <pryzby@telsasoft.com>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Remove dead code
Date: Thu, 22 Dec 2022 09:30:41 -0600
Message-ID: <20221222153041.GN1153@telsasoft.com> (raw)
In-Reply-To: <E1p8Ftl-004pye-Eh@gemulon.postgresql.org>
References: <E1p8Ftl-004pye-Eh@gemulon.postgresql.org>
On Thu, Dec 22, 2022 at 07:21:50AM +0000, Peter Eisentraut wrote:
> Remove dead code
>
> The second appearance of NamespaceRelationId in this if-else chain is
> in error and can be removed.
This caused me to notice various wrong-looking elog()s.
inline patch 1: src/backend/catalog/aclchk.c (+3/-3 lines) download inline-1.patchdiff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.cindex 35a09ea8dac..444407260be 100644--- a/src/backend/catalog/aclchk.c+++ b/src/backend/catalog/aclchk.c@@ -4365,19 +4365,19 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
/* pg_foreign_server */
else if (classoid == ForeignServerRelationId)
{
Datum aclDatum;
bool isNull;
HeapTuple tuple;
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,
Anum_pg_foreign_server_srvacl,
&isNull);
/* Add the record, if any, for the top-level object */
if (!isNull)
recordExtensionInitPrivWorker(objoid, classoid, 0,
@@ -4451,19 +4451,19 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
/* pg_namespace */
else if (classoid == NamespaceRelationId)
{
Datum aclDatum;
bool isNull;
HeapTuple tuple;
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);
/* Add the record, if any, for the top-level object */
if (!isNull)
recordExtensionInitPrivWorker(objoid, classoid, 0,
DatumGetAclP(aclDatum));
@@ -4493,19 +4493,19 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
/* pg_type */
else if (classoid == TypeRelationId)
{
Datum aclDatum;
bool isNull;
HeapTuple tuple;
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);
/* Add the record, if any, for the top-level object */
if (!isNull)
recordExtensionInitPrivWorker(objoid, classoid, 0,
DatumGetAclP(aclDatum));
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: pryzby@telsasoft.com, peter@eisentraut.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Remove dead code
In-Reply-To: <20221222153041.GN1153@telsasoft.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox