pgsql: Simplify some code in getObjectTypeDescription()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Simplify some code in getObjectTypeDescription()
Date: 2021-06-12 07:30:02
Message-ID: E1lry5i-0003ww-BK@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2021-06-12 10:36:41 Re: pgsql: Make archiver process an auxiliary process.
Previous Message Michael Paquier 2021-06-12 06:30:26 pgsql: Improve log pattern detection in recently-added TAP tests