pgsql: Switch SysCacheIdentifier to a typedef enum

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Switch SysCacheIdentifier to a typedef enum
Date: 2026-02-18 00:59:56
Message-ID: E1vsVv1-001MZs-28@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Switch SysCacheIdentifier to a typedef enum

The main purpose of this change is to allow an ABI checker to understand
when the list of SysCacheIdentifier changes, by switching all the
routine declarations that relied on a signed integer for a syscache ID
to this new type. This is going to be useful in the long-term for
versions newer than v19 so as we will be able to check when the list of
values in SysCacheIdentifier is updated in a non-ABI compliant fashion.

Most of the changes of this commit are due to the new definition of
SyscacheCallbackFunction, where a SysCacheIdentifier is now required for
the syscache ID. It is a mechanical change, still slightly invasive.

There are more areas in the tree that could be improved with an ABI
checker in mind; this takes care of only one area.

Reported-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Author: Andreas Karlsson <andreas(at)proxel(dot)se>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://postgr.es/m/289125.1770913057@sss.pgh.pa.us

Branch
------
master

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

Modified Files
--------------
contrib/postgres_fdw/connection.c | 5 +++--
contrib/postgres_fdw/shippable.c | 3 ++-
src/backend/catalog/aclchk.c | 10 ++++-----
src/backend/catalog/dependency.c | 2 +-
src/backend/catalog/genbki.pl | 4 ++--
src/backend/catalog/namespace.c | 5 +++--
src/backend/catalog/objectaddress.c | 17 ++++++++-------
src/backend/commands/alter.c | 8 +++----
src/backend/commands/extension.c | 5 +++--
src/backend/optimizer/util/predtest.c | 6 +++--
src/backend/parser/parse_oper.c | 6 +++--
src/backend/replication/logical/syncutils.c | 3 ++-
src/backend/replication/logical/worker.c | 2 +-
src/backend/replication/pgoutput/pgoutput.c | 10 +++++----
src/backend/utils/adt/acl.c | 6 +++--
src/backend/utils/adt/ri_triggers.c | 6 +++--
src/backend/utils/cache/attoptcache.c | 3 ++-
src/backend/utils/cache/evtcache.c | 6 +++--
src/backend/utils/cache/inval.c | 4 ++--
src/backend/utils/cache/plancache.c | 10 +++++----
src/backend/utils/cache/spccache.c | 3 ++-
src/backend/utils/cache/syscache.c | 34 ++++++++++++++---------------
src/backend/utils/cache/ts_cache.c | 2 +-
src/backend/utils/cache/typcache.c | 15 ++++++++-----
src/backend/utils/misc/superuser.c | 5 +++--
src/include/catalog/objectaddress.h | 5 +++--
src/include/replication/worker_internal.h | 3 ++-
src/include/utils/inval.h | 8 ++++---
src/include/utils/syscache.h | 30 ++++++++++++-------------
29 files changed, 128 insertions(+), 98 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2026-02-18 07:07:39 pgsql: Force creation of stamp file after libpq library check in meson
Previous Message Michael Paquier 2026-02-18 00:26:35 pgsql: Add concept of invalid value to SysCacheIdentifier