]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Add a syscache on pg_extension.oid.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 9 Feb 2026 15:02:23 +0000 (10:02 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 9 Feb 2026 15:02:23 +0000 (10:02 -0500)
commitd484bc26013caedd0b210bddfcec43c2ab6fa649
treead93ebf7fade15013917531e540e5f629c017f5e
parent595956fc7268b5183c1e0e39673e478febbd008f
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
src/backend/utils/cache/syscache.c
src/include/utils/syscache.h