From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Simplify some code in getObjectTypeDescription()
Date: Sat, 12 Jun 2021 07:30:02 +0000
Message-ID: <E1lry5i-0003ww-BK@gemulon.postgresql.org> (raw)
Simplify some code in getObjectTypeDescription()
This routine is designed to never return an empty description or NULL,
providing description fallbacks even if missing objects are accepted,
but it included a code path where this was considered possible. All the
callers of this routine already consider NULL as not possible, so
change a bit the code to map with the assumptions of the callers, and
add more comments close to the callers of this routine to outline the
behavior expected.
This code is new as of 2a10fdc, so no backpatch is needed.
Discussion: https://postgr.es/m/YMNY6RGPBRCeLmFb@paquier.xyz
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/b56b83aa0d6e044cf38d553f7a87f4b84708cac6
Modified Files
--------------
src/backend/catalog/objectaddress.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz
Subject: Re: pgsql: Simplify some code in getObjectTypeDescription()
In-Reply-To: <E1lry5i-0003ww-BK@gemulon.postgresql.org>
References: <E1lry5i-0003ww-BK@gemulon.postgresql.org>
* 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