pgsql: Add concept of invalid value to SysCacheIdentifier - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Add concept of invalid value to SysCacheIdentifier
Date
Msg-id E1vsVOk-001ML8-2q@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Add concept of invalid value to SysCacheIdentifier

This commit tweaks the generation of the syscache IDs for the enum
SysCacheIdentifier to now include an invalid value, with -1 assigned as
value.  The concept of an invalid syscache ID exists when handling
lookups of a ObjectAddress, based on their set of properties in
ObjectPropertyType.  -1 is used for the case where an object type has no
option for a syscache lookup.

This has been found as independently useful while discussing a switch of
SysCacheIdentifier to a typedef, as we already have places that want to
know about the concept of an invalid value when dealing with
ObjectAddresses.

Reviewed-by: Andreas Karlsson <andreas@proxel.se>
Discussion: https://postgr.es/m/aZQRnmp9nVjtxAHS@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c06b5b99bbb0d0e5ddeea9661ec7678e3cf53b4c

Modified Files
--------------
src/backend/catalog/aclchk.c        |  2 +-
src/backend/catalog/genbki.pl       | 11 +++++--
src/backend/catalog/objectaddress.c | 62 ++++++++++++++++++-------------------
3 files changed, 41 insertions(+), 34 deletions(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Fix one-off issue with cache ID in objectaddress.c
Next
From: Michael Paquier
Date:
Subject: pgsql: Switch SysCacheIdentifier to a typedef enum