public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: [email protected]
Subject: pgsql: Add concept of invalid value to SysCacheIdentifier
Date: Wed, 18 Feb 2026 00:26:35 +0000
Message-ID: <[email protected]> (raw)

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 <[email protected]>
Discussion: https://postgr.es/m/[email protected]

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



reply

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Add concept of invalid value to SysCacheIdentifier
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox