pgsql: Add a syscache on pg_extension.oid. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Add a syscache on pg_extension.oid.
Date
Msg-id E1vpSyf-0026BQ-17@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Add a syscache on pg_extension.oid.

An upcoming patch requires this cache so that it can track updates
in the pg_extension catalog.  So far though, the EXTENSIONOID cache
only exists in v18 and up (see 490f869d9).  We can add it in older
branches without an ABI break, if we are careful not to disturb the
numbering of existing syscache IDs.

In v16 and before, that just requires adding the new ID at the end
of the hand-assigned enum list, ignoring our convention about
alphabetizing the IDs.  But in v17, genbki.pl enforces alphabetical
order of the IDs listed in MAKE_SYSCACHE macros.  We can fake it
out by calling the new cache ZEXTENSIONOID.

Note that adding a syscache does change the required contents of the
relcache init file (pg_internal.init).  But that isn't problematic
since we blow those away at postmaster start for other reasons.

Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Noah Misch <noah@leadboat.com>
Security: CVE-2026-2004
Backpatch-through: 14-17

Branch
------
REL_17_STABLE

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

Modified Files
--------------
src/include/catalog/pg_extension.h | 9 +++++++++
1 file changed, 9 insertions(+)


pgsql-committers by date:

Previous
From: Noah Misch
Date:
Subject: pgsql: Require PGP-decrypted text to pass encoding validation.
Next
From: Tom Lane
Date:
Subject: pgsql: Guard against unexpected dimensions of oidvector/int2vector.