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@sss.pgh.pa.us>
Author: Andreas Karlsson <andreas@proxel.se>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/289125.1770913057@sss.pgh.pa.us
This commit is contained in:
Michael Paquier 2026-02-18 09:58:38 +09:00
parent c06b5b99bb
commit ee642cccc4
29 changed files with 128 additions and 98 deletions

View file

@ -150,7 +150,8 @@ static void pgfdw_subxact_callback(SubXactEvent event,
SubTransactionId mySubid, SubTransactionId mySubid,
SubTransactionId parentSubid, SubTransactionId parentSubid,
void *arg); void *arg);
static void pgfdw_inval_callback(Datum arg, int cacheid, uint32 hashvalue); static void pgfdw_inval_callback(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue);
static void pgfdw_reject_incomplete_xact_state_change(ConnCacheEntry *entry); static void pgfdw_reject_incomplete_xact_state_change(ConnCacheEntry *entry);
static void pgfdw_reset_xact_state(ConnCacheEntry *entry, bool toplevel); static void pgfdw_reset_xact_state(ConnCacheEntry *entry, bool toplevel);
static bool pgfdw_cancel_query(PGconn *conn); static bool pgfdw_cancel_query(PGconn *conn);
@ -1309,7 +1310,7 @@ pgfdw_subxact_callback(SubXactEvent event, SubTransactionId mySubid,
* individual option values, but it seems too much effort for the gain. * individual option values, but it seems too much effort for the gain.
*/ */
static void static void
pgfdw_inval_callback(Datum arg, int cacheid, uint32 hashvalue) pgfdw_inval_callback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{ {
HASH_SEQ_STATUS scan; HASH_SEQ_STATUS scan;
ConnCacheEntry *entry; ConnCacheEntry *entry;

View file

@ -62,7 +62,8 @@ typedef struct
* made for them, however. * made for them, however.
*/ */
static void static void
InvalidateShippableCacheCallback(Datum arg, int cacheid, uint32 hashvalue) InvalidateShippableCacheCallback(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue)
{ {
HASH_SEQ_STATUS status; HASH_SEQ_STATUS status;
ShippableCacheEntry *entry; ShippableCacheEntry *entry;

View file

@ -2115,7 +2115,7 @@ static void
ExecGrant_common(InternalGrant *istmt, Oid classid, AclMode default_privs, ExecGrant_common(InternalGrant *istmt, Oid classid, AclMode default_privs,
void (*object_check) (InternalGrant *istmt, HeapTuple tuple)) void (*object_check) (InternalGrant *istmt, HeapTuple tuple))
{ {
int cacheid; SysCacheIdentifier cacheid;
Relation relation; Relation relation;
ListCell *cell; ListCell *cell;
@ -3058,7 +3058,7 @@ object_aclmask_ext(Oid classid, Oid objectid, Oid roleid,
AclMode mask, AclMaskHow how, AclMode mask, AclMaskHow how,
bool *is_missing) bool *is_missing)
{ {
int cacheid; SysCacheIdentifier cacheid;
AclMode result; AclMode result;
HeapTuple tuple; HeapTuple tuple;
Datum aclDatum; Datum aclDatum;
@ -4089,7 +4089,7 @@ pg_largeobject_aclcheck_snapshot(Oid lobj_oid, Oid roleid, AclMode mode,
bool bool
object_ownercheck(Oid classid, Oid objectid, Oid roleid) object_ownercheck(Oid classid, Oid objectid, Oid roleid)
{ {
int cacheid; SysCacheIdentifier cacheid;
Oid ownerId; Oid ownerId;
/* Superusers bypass all permission checking. */ /* Superusers bypass all permission checking. */
@ -4486,7 +4486,7 @@ recordExtObjInitPriv(Oid objoid, Oid classoid)
/* This will error on unsupported classoid. */ /* This will error on unsupported classoid. */
else if (get_object_attnum_acl(classoid) != InvalidAttrNumber) else if (get_object_attnum_acl(classoid) != InvalidAttrNumber)
{ {
int cacheid; SysCacheIdentifier cacheid;
Datum aclDatum; Datum aclDatum;
bool isNull; bool isNull;
HeapTuple tuple; HeapTuple tuple;
@ -4870,7 +4870,7 @@ RemoveRoleFromInitPriv(Oid roleid, Oid classid, Oid objid, int32 objsubid)
ScanKeyData key[3]; ScanKeyData key[3];
SysScanDesc scan; SysScanDesc scan;
HeapTuple oldtuple; HeapTuple oldtuple;
int cacheid; SysCacheIdentifier cacheid;
HeapTuple objtuple; HeapTuple objtuple;
Oid ownerId; Oid ownerId;
Datum oldAclDatum; Datum oldAclDatum;

View file

@ -1238,7 +1238,7 @@ reportDependentObjects(const ObjectAddresses *targetObjects,
static void static void
DropObjectById(const ObjectAddress *object) DropObjectById(const ObjectAddress *object)
{ {
int cacheId; SysCacheIdentifier cacheId;
Relation rel; Relation rel;
HeapTuple tup; HeapTuple tup;

View file

@ -795,7 +795,7 @@ print $fk_info "};\n\n#endif\t\t\t\t\t\t\t/* SYSTEM_FK_INFO_H */\n";
# Now generate syscache info # Now generate syscache info
print_boilerplate($syscache_ids_fh, "syscache_ids.h", "SysCache identifiers"); print_boilerplate($syscache_ids_fh, "syscache_ids.h", "SysCache identifiers");
print $syscache_ids_fh "enum SysCacheIdentifier print $syscache_ids_fh "typedef enum SysCacheIdentifier
{ {
\tSYSCACHEID_INVALID = -1,\n"; \tSYSCACHEID_INVALID = -1,\n";
@ -832,7 +832,7 @@ foreach my $syscache (sort keys %syscaches)
print $syscache_info_fh "\t},\n"; print $syscache_info_fh "\t},\n";
} }
print $syscache_ids_fh "};\n"; print $syscache_ids_fh "} SysCacheIdentifier;\n";
print $syscache_ids_fh "#define SysCacheSize ($last_syscache + 1)\n"; print $syscache_ids_fh "#define SysCacheSize ($last_syscache + 1)\n";
print $syscache_info_fh "};\n"; print $syscache_info_fh "};\n";

View file

@ -229,7 +229,8 @@ static void AccessTempTableNamespace(bool force);
static void InitTempTableNamespace(void); static void InitTempTableNamespace(void);
static void RemoveTempRelations(Oid tempNamespaceId); static void RemoveTempRelations(Oid tempNamespaceId);
static void RemoveTempRelationsCallback(int code, Datum arg); static void RemoveTempRelationsCallback(int code, Datum arg);
static void InvalidationCallback(Datum arg, int cacheid, uint32 hashvalue); static void InvalidationCallback(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue);
static bool MatchNamedCall(HeapTuple proctup, int nargs, List *argnames, static bool MatchNamedCall(HeapTuple proctup, int nargs, List *argnames,
bool include_out_arguments, int pronargs, bool include_out_arguments, int pronargs,
int **argnumbers, int *fgc_flags); int **argnumbers, int *fgc_flags);
@ -4863,7 +4864,7 @@ InitializeSearchPath(void)
* Syscache inval callback function * Syscache inval callback function
*/ */
static void static void
InvalidationCallback(Datum arg, int cacheid, uint32 hashvalue) InvalidationCallback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{ {
/* /*
* Force search path to be recomputed on next use, also invalidating the * Force search path to be recomputed on next use, also invalidating the

View file

@ -99,10 +99,11 @@ typedef struct
* error messages */ * error messages */
Oid class_oid; /* oid of catalog */ Oid class_oid; /* oid of catalog */
Oid oid_index_oid; /* oid of index on system oid column */ Oid oid_index_oid; /* oid of index on system oid column */
int oid_catcache_id; /* id of catcache on system oid column */ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */
int name_catcache_id; /* id of catcache on (name,namespace), or SysCacheIdentifier name_catcache_id; /* id of catcache on
* (name) if the object does not live in a * (name,namespace), or (name) if
* namespace */ * the object does not live in a
* namespace */
AttrNumber attnum_oid; /* attribute number of oid column */ AttrNumber attnum_oid; /* attribute number of oid column */
AttrNumber attnum_name; /* attnum of name field */ AttrNumber attnum_name; /* attnum of name field */
AttrNumber attnum_namespace; /* attnum of namespace field */ AttrNumber attnum_namespace; /* attnum of namespace field */
@ -2571,7 +2572,7 @@ check_object_ownership(Oid roleid, ObjectType objtype, ObjectAddress address,
Oid Oid
get_object_namespace(const ObjectAddress *address) get_object_namespace(const ObjectAddress *address)
{ {
int cache; SysCacheIdentifier cache;
HeapTuple tuple; HeapTuple tuple;
Oid oid; Oid oid;
const ObjectPropertyType *property; const ObjectPropertyType *property;
@ -2640,7 +2641,7 @@ get_object_oid_index(Oid class_id)
return prop->oid_index_oid; return prop->oid_index_oid;
} }
int SysCacheIdentifier
get_object_catcache_oid(Oid class_id) get_object_catcache_oid(Oid class_id)
{ {
const ObjectPropertyType *prop = get_object_property_data(class_id); const ObjectPropertyType *prop = get_object_property_data(class_id);
@ -2648,7 +2649,7 @@ get_object_catcache_oid(Oid class_id)
return prop->oid_catcache_id; return prop->oid_catcache_id;
} }
int SysCacheIdentifier
get_object_catcache_name(Oid class_id) get_object_catcache_name(Oid class_id)
{ {
const ObjectPropertyType *prop = get_object_property_data(class_id); const ObjectPropertyType *prop = get_object_property_data(class_id);
@ -2806,7 +2807,7 @@ get_catalog_object_by_oid_extended(Relation catalog,
{ {
HeapTuple tuple; HeapTuple tuple;
Oid classId = RelationGetRelid(catalog); Oid classId = RelationGetRelid(catalog);
int oidCacheId = get_object_catcache_oid(classId); SysCacheIdentifier oidCacheId = get_object_catcache_oid(classId);
if (oidCacheId >= 0) if (oidCacheId >= 0)
{ {

View file

@ -159,8 +159,8 @@ static void
AlterObjectRename_internal(Relation rel, Oid objectId, const char *new_name) AlterObjectRename_internal(Relation rel, Oid objectId, const char *new_name)
{ {
Oid classId = RelationGetRelid(rel); Oid classId = RelationGetRelid(rel);
int oidCacheId = get_object_catcache_oid(classId); SysCacheIdentifier oidCacheId = get_object_catcache_oid(classId);
int nameCacheId = get_object_catcache_name(classId); SysCacheIdentifier nameCacheId = get_object_catcache_name(classId);
AttrNumber Anum_name = get_object_attnum_name(classId); AttrNumber Anum_name = get_object_attnum_name(classId);
AttrNumber Anum_namespace = get_object_attnum_namespace(classId); AttrNumber Anum_namespace = get_object_attnum_namespace(classId);
AttrNumber Anum_owner = get_object_attnum_owner(classId); AttrNumber Anum_owner = get_object_attnum_owner(classId);
@ -686,8 +686,8 @@ static Oid
AlterObjectNamespace_internal(Relation rel, Oid objid, Oid nspOid) AlterObjectNamespace_internal(Relation rel, Oid objid, Oid nspOid)
{ {
Oid classId = RelationGetRelid(rel); Oid classId = RelationGetRelid(rel);
int oidCacheId = get_object_catcache_oid(classId); SysCacheIdentifier oidCacheId = get_object_catcache_oid(classId);
int nameCacheId = get_object_catcache_name(classId); SysCacheIdentifier nameCacheId = get_object_catcache_name(classId);
AttrNumber Anum_name = get_object_attnum_name(classId); AttrNumber Anum_name = get_object_attnum_name(classId);
AttrNumber Anum_namespace = get_object_attnum_namespace(classId); AttrNumber Anum_namespace = get_object_attnum_namespace(classId);
AttrNumber Anum_owner = get_object_attnum_owner(classId); AttrNumber Anum_owner = get_object_attnum_owner(classId);

View file

@ -162,7 +162,8 @@ typedef struct ExtensionSiblingCache
static ExtensionSiblingCache *ext_sibling_list = NULL; static ExtensionSiblingCache *ext_sibling_list = NULL;
/* Local functions */ /* Local functions */
static void ext_sibling_callback(Datum arg, int cacheid, uint32 hashvalue); static void ext_sibling_callback(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue);
static List *find_update_path(List *evi_list, static List *find_update_path(List *evi_list,
ExtensionVersionInfo *evi_start, ExtensionVersionInfo *evi_start,
ExtensionVersionInfo *evi_target, ExtensionVersionInfo *evi_target,
@ -379,7 +380,7 @@ get_function_sibling_type(Oid funcoid, const char *typname)
* looking for, could change without an extension update or drop/recreate. * looking for, could change without an extension update or drop/recreate.
*/ */
static void static void
ext_sibling_callback(Datum arg, int cacheid, uint32 hashvalue) ext_sibling_callback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{ {
ExtensionSiblingCache *cache_entry; ExtensionSiblingCache *cache_entry;

View file

@ -109,7 +109,8 @@ static bool operator_same_subexprs_proof(Oid pred_op, Oid clause_op,
static bool operator_same_subexprs_lookup(Oid pred_op, Oid clause_op, static bool operator_same_subexprs_lookup(Oid pred_op, Oid clause_op,
bool refute_it); bool refute_it);
static Oid get_btree_test_op(Oid pred_op, Oid clause_op, bool refute_it); static Oid get_btree_test_op(Oid pred_op, Oid clause_op, bool refute_it);
static void InvalidateOprProofCacheCallBack(Datum arg, int cacheid, uint32 hashvalue); static void InvalidateOprProofCacheCallBack(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue);
/* /*
@ -2343,7 +2344,8 @@ get_btree_test_op(Oid pred_op, Oid clause_op, bool refute_it)
* Callback for pg_amop inval events * Callback for pg_amop inval events
*/ */
static void static void
InvalidateOprProofCacheCallBack(Datum arg, int cacheid, uint32 hashvalue) InvalidateOprProofCacheCallBack(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue)
{ {
HASH_SEQ_STATUS status; HASH_SEQ_STATUS status;
OprProofCacheEntry *hentry; OprProofCacheEntry *hentry;

View file

@ -79,7 +79,8 @@ static bool make_oper_cache_key(ParseState *pstate, OprCacheKey *key,
int location); int location);
static Oid find_oper_cache_entry(OprCacheKey *key); static Oid find_oper_cache_entry(OprCacheKey *key);
static void make_oper_cache_entry(OprCacheKey *key, Oid opr_oid); static void make_oper_cache_entry(OprCacheKey *key, Oid opr_oid);
static void InvalidateOprCacheCallBack(Datum arg, int cacheid, uint32 hashvalue); static void InvalidateOprCacheCallBack(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue);
/* /*
@ -1076,7 +1077,8 @@ make_oper_cache_entry(OprCacheKey *key, Oid opr_oid)
* Callback for pg_operator and pg_cast inval events * Callback for pg_operator and pg_cast inval events
*/ */
static void static void
InvalidateOprCacheCallBack(Datum arg, int cacheid, uint32 hashvalue) InvalidateOprCacheCallBack(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue)
{ {
HASH_SEQ_STATUS status; HASH_SEQ_STATUS status;
OprCacheEntry *hentry; OprCacheEntry *hentry;

View file

@ -98,7 +98,8 @@ FinishSyncWorker(void)
* Callback from syscache invalidation. * Callback from syscache invalidation.
*/ */
void void
InvalidateSyncingRelStates(Datum arg, int cacheid, uint32 hashvalue) InvalidateSyncingRelStates(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue)
{ {
relation_states_validity = SYNC_RELATIONS_STATE_NEEDS_REBUILD; relation_states_validity = SYNC_RELATIONS_STATE_NEEDS_REBUILD;
} }

View file

@ -5164,7 +5164,7 @@ maybe_reread_subscription(void)
* Callback from subscription syscache invalidation. * Callback from subscription syscache invalidation.
*/ */
static void static void
subscription_change_cb(Datum arg, int cacheid, uint32 hashvalue) subscription_change_cb(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{ {
MySubscriptionValid = false; MySubscriptionValid = false;
} }

View file

@ -86,7 +86,7 @@ static void pgoutput_stream_prepare_txn(LogicalDecodingContext *ctx,
static bool publications_valid; static bool publications_valid;
static List *LoadPublications(List *pubnames); static List *LoadPublications(List *pubnames);
static void publication_invalidation_cb(Datum arg, int cacheid, static void publication_invalidation_cb(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue); uint32 hashvalue);
static void send_repl_origin(LogicalDecodingContext *ctx, static void send_repl_origin(LogicalDecodingContext *ctx,
ReplOriginId origin_id, XLogRecPtr origin_lsn, ReplOriginId origin_id, XLogRecPtr origin_lsn,
@ -227,7 +227,7 @@ static void send_relation_and_attrs(Relation relation, TransactionId xid,
LogicalDecodingContext *ctx, LogicalDecodingContext *ctx,
RelationSyncEntry *relentry); RelationSyncEntry *relentry);
static void rel_sync_cache_relation_cb(Datum arg, Oid relid); static void rel_sync_cache_relation_cb(Datum arg, Oid relid);
static void rel_sync_cache_publication_cb(Datum arg, int cacheid, static void rel_sync_cache_publication_cb(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue); uint32 hashvalue);
static void set_schema_sent_in_streamed_txn(RelationSyncEntry *entry, static void set_schema_sent_in_streamed_txn(RelationSyncEntry *entry,
TransactionId xid); TransactionId xid);
@ -1828,7 +1828,8 @@ LoadPublications(List *pubnames)
* Called for invalidations on pg_publication. * Called for invalidations on pg_publication.
*/ */
static void static void
publication_invalidation_cb(Datum arg, int cacheid, uint32 hashvalue) publication_invalidation_cb(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue)
{ {
publications_valid = false; publications_valid = false;
} }
@ -2431,7 +2432,8 @@ rel_sync_cache_relation_cb(Datum arg, Oid relid)
* Called for invalidations on pg_namespace. * Called for invalidations on pg_namespace.
*/ */
static void static void
rel_sync_cache_publication_cb(Datum arg, int cacheid, uint32 hashvalue) rel_sync_cache_publication_cb(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue)
{ {
HASH_SEQ_STATUS status; HASH_SEQ_STATUS status;
RelationSyncEntry *entry; RelationSyncEntry *entry;

View file

@ -130,7 +130,8 @@ static AclMode convert_largeobject_priv_string(text *priv_type_text);
static AclMode convert_role_priv_string(text *priv_type_text); static AclMode convert_role_priv_string(text *priv_type_text);
static AclResult pg_role_aclcheck(Oid role_oid, Oid roleid, AclMode mode); static AclResult pg_role_aclcheck(Oid role_oid, Oid roleid, AclMode mode);
static void RoleMembershipCacheCallback(Datum arg, int cacheid, uint32 hashvalue); static void RoleMembershipCacheCallback(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue);
/* /*
@ -5067,7 +5068,8 @@ initialize_acl(void)
* Syscache inval callback function * Syscache inval callback function
*/ */
static void static void
RoleMembershipCacheCallback(Datum arg, int cacheid, uint32 hashvalue) RoleMembershipCacheCallback(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue)
{ {
if (cacheid == DATABASEOID && if (cacheid == DATABASEOID &&
hashvalue != cached_db_hash && hashvalue != cached_db_hash &&

View file

@ -213,7 +213,8 @@ static bool ri_CompareWithCast(Oid eq_opr, Oid typeid, Oid collid,
Datum lhs, Datum rhs); Datum lhs, Datum rhs);
static void ri_InitHashTables(void); static void ri_InitHashTables(void);
static void InvalidateConstraintCacheCallBack(Datum arg, int cacheid, uint32 hashvalue); static void InvalidateConstraintCacheCallBack(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue);
static SPIPlanPtr ri_FetchPreparedPlan(RI_QueryKey *key); static SPIPlanPtr ri_FetchPreparedPlan(RI_QueryKey *key);
static void ri_HashPreparedPlan(RI_QueryKey *key, SPIPlanPtr plan); static void ri_HashPreparedPlan(RI_QueryKey *key, SPIPlanPtr plan);
static RI_CompareHashEntry *ri_HashCompareOp(Oid eq_opr, Oid typeid); static RI_CompareHashEntry *ri_HashCompareOp(Oid eq_opr, Oid typeid);
@ -2397,7 +2398,8 @@ get_ri_constraint_root(Oid constrOid)
* data from changing under it --- but we may get cache flushes anyway.) * data from changing under it --- but we may get cache flushes anyway.)
*/ */
static void static void
InvalidateConstraintCacheCallBack(Datum arg, int cacheid, uint32 hashvalue) InvalidateConstraintCacheCallBack(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue)
{ {
dlist_mutable_iter iter; dlist_mutable_iter iter;

View file

@ -50,7 +50,8 @@ typedef struct
* for that attribute. * for that attribute.
*/ */
static void static void
InvalidateAttoptCacheCallback(Datum arg, int cacheid, uint32 hashvalue) InvalidateAttoptCacheCallback(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue)
{ {
HASH_SEQ_STATUS status; HASH_SEQ_STATUS status;
AttoptCacheEntry *attopt; AttoptCacheEntry *attopt;

View file

@ -49,7 +49,8 @@ static EventTriggerCacheStateType EventTriggerCacheState = ETCS_NEEDS_REBUILD;
static void BuildEventTriggerCache(void); static void BuildEventTriggerCache(void);
static void InvalidateEventCacheCallback(Datum arg, static void InvalidateEventCacheCallback(Datum arg,
int cacheid, uint32 hashvalue); SysCacheIdentifier cacheid,
uint32 hashvalue);
static Bitmapset *DecodeTextArrayToBitmapset(Datum array); static Bitmapset *DecodeTextArrayToBitmapset(Datum array);
/* /*
@ -254,7 +255,8 @@ DecodeTextArrayToBitmapset(Datum array)
* memory leaks. * memory leaks.
*/ */
static void static void
InvalidateEventCacheCallback(Datum arg, int cacheid, uint32 hashvalue) InvalidateEventCacheCallback(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue)
{ {
/* /*
* If the cache isn't valid, then there might be a rebuild in progress, so * If the cache isn't valid, then there might be a rebuild in progress, so

View file

@ -1813,7 +1813,7 @@ CacheInvalidateRelmap(Oid databaseId)
* flush all cached state anyway. * flush all cached state anyway.
*/ */
void void
CacheRegisterSyscacheCallback(int cacheid, CacheRegisterSyscacheCallback(SysCacheIdentifier cacheid,
SyscacheCallbackFunction func, SyscacheCallbackFunction func,
Datum arg) Datum arg)
{ {
@ -1895,7 +1895,7 @@ CacheRegisterRelSyncCallback(RelSyncCallbackFunction func,
* this module from knowing which catcache IDs correspond to which catalogs. * this module from knowing which catcache IDs correspond to which catalogs.
*/ */
void void
CallSyscacheCallbacks(int cacheid, uint32 hashvalue) CallSyscacheCallbacks(SysCacheIdentifier cacheid, uint32 hashvalue)
{ {
int i; int i;

View file

@ -106,8 +106,10 @@ static void ScanQueryForLocks(Query *parsetree, bool acquire);
static bool ScanQueryWalker(Node *node, bool *acquire); static bool ScanQueryWalker(Node *node, bool *acquire);
static TupleDesc PlanCacheComputeResultDesc(List *stmt_list); static TupleDesc PlanCacheComputeResultDesc(List *stmt_list);
static void PlanCacheRelCallback(Datum arg, Oid relid); static void PlanCacheRelCallback(Datum arg, Oid relid);
static void PlanCacheObjectCallback(Datum arg, int cacheid, uint32 hashvalue); static void PlanCacheObjectCallback(Datum arg, SysCacheIdentifier cacheid,
static void PlanCacheSysCallback(Datum arg, int cacheid, uint32 hashvalue); uint32 hashvalue);
static void PlanCacheSysCallback(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue);
/* ResourceOwner callbacks to track plancache references */ /* ResourceOwner callbacks to track plancache references */
static void ResOwnerReleaseCachedPlan(Datum res); static void ResOwnerReleaseCachedPlan(Datum res);
@ -2201,7 +2203,7 @@ PlanCacheRelCallback(Datum arg, Oid relid)
* or all plans mentioning any member of this cache if hashvalue == 0. * or all plans mentioning any member of this cache if hashvalue == 0.
*/ */
static void static void
PlanCacheObjectCallback(Datum arg, int cacheid, uint32 hashvalue) PlanCacheObjectCallback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{ {
dlist_iter iter; dlist_iter iter;
@ -2310,7 +2312,7 @@ PlanCacheObjectCallback(Datum arg, int cacheid, uint32 hashvalue)
* Just invalidate everything... * Just invalidate everything...
*/ */
static void static void
PlanCacheSysCallback(Datum arg, int cacheid, uint32 hashvalue) PlanCacheSysCallback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{ {
ResetPlanCache(); ResetPlanCache();
} }

View file

@ -52,7 +52,8 @@ typedef struct
* tablespaces, nor do we expect them to be frequently modified. * tablespaces, nor do we expect them to be frequently modified.
*/ */
static void static void
InvalidateTableSpaceCacheCallback(Datum arg, int cacheid, uint32 hashvalue) InvalidateTableSpaceCacheCallback(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue)
{ {
HASH_SEQ_STATUS status; HASH_SEQ_STATUS status;
TableSpaceCacheEntry *spc; TableSpaceCacheEntry *spc;

View file

@ -109,7 +109,7 @@ static int oid_compare(const void *a, const void *b);
void void
InitCatalogCache(void) InitCatalogCache(void)
{ {
int cacheId; SysCacheIdentifier cacheId;
Assert(!CacheInitialized); Assert(!CacheInitialized);
@ -179,7 +179,7 @@ InitCatalogCache(void)
void void
InitCatalogCachePhase2(void) InitCatalogCachePhase2(void)
{ {
int cacheId; SysCacheIdentifier cacheId;
Assert(CacheInitialized); Assert(CacheInitialized);
@ -205,7 +205,7 @@ InitCatalogCachePhase2(void)
* CAUTION: The tuple that is returned must NOT be freed by the caller! * CAUTION: The tuple that is returned must NOT be freed by the caller!
*/ */
HeapTuple HeapTuple
SearchSysCache(int cacheId, SearchSysCache(SysCacheIdentifier cacheId,
Datum key1, Datum key1,
Datum key2, Datum key2,
Datum key3, Datum key3,
@ -217,7 +217,7 @@ SearchSysCache(int cacheId,
} }
HeapTuple HeapTuple
SearchSysCache1(int cacheId, SearchSysCache1(SysCacheIdentifier cacheId,
Datum key1) Datum key1)
{ {
Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]); Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]);
@ -227,7 +227,7 @@ SearchSysCache1(int cacheId,
} }
HeapTuple HeapTuple
SearchSysCache2(int cacheId, SearchSysCache2(SysCacheIdentifier cacheId,
Datum key1, Datum key2) Datum key1, Datum key2)
{ {
Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]); Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]);
@ -237,7 +237,7 @@ SearchSysCache2(int cacheId,
} }
HeapTuple HeapTuple
SearchSysCache3(int cacheId, SearchSysCache3(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3) Datum key1, Datum key2, Datum key3)
{ {
Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]); Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]);
@ -247,7 +247,7 @@ SearchSysCache3(int cacheId,
} }
HeapTuple HeapTuple
SearchSysCache4(int cacheId, SearchSysCache4(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3, Datum key4) Datum key1, Datum key2, Datum key3, Datum key4)
{ {
Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]); Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]);
@ -279,7 +279,7 @@ ReleaseSysCache(HeapTuple tuple)
* doesn't prevent the "tuple concurrently updated" error. * doesn't prevent the "tuple concurrently updated" error.
*/ */
HeapTuple HeapTuple
SearchSysCacheLocked1(int cacheId, SearchSysCacheLocked1(SysCacheIdentifier cacheId,
Datum key1) Datum key1)
{ {
CatCache *cache = SysCache[cacheId]; CatCache *cache = SysCache[cacheId];
@ -371,7 +371,7 @@ SearchSysCacheLocked1(int cacheId,
* heap_freetuple() the result when done with it. * heap_freetuple() the result when done with it.
*/ */
HeapTuple HeapTuple
SearchSysCacheCopy(int cacheId, SearchSysCacheCopy(SysCacheIdentifier cacheId,
Datum key1, Datum key1,
Datum key2, Datum key2,
Datum key3, Datum key3,
@ -396,7 +396,7 @@ SearchSysCacheCopy(int cacheId,
* heap_freetuple(). * heap_freetuple().
*/ */
HeapTuple HeapTuple
SearchSysCacheLockedCopy1(int cacheId, SearchSysCacheLockedCopy1(SysCacheIdentifier cacheId,
Datum key1) Datum key1)
{ {
HeapTuple tuple, HeapTuple tuple,
@ -417,7 +417,7 @@ SearchSysCacheLockedCopy1(int cacheId,
* No lock is retained on the syscache entry. * No lock is retained on the syscache entry.
*/ */
bool bool
SearchSysCacheExists(int cacheId, SearchSysCacheExists(SysCacheIdentifier cacheId,
Datum key1, Datum key1,
Datum key2, Datum key2,
Datum key3, Datum key3,
@ -440,7 +440,7 @@ SearchSysCacheExists(int cacheId,
* No lock is retained on the syscache entry. * No lock is retained on the syscache entry.
*/ */
Oid Oid
GetSysCacheOid(int cacheId, GetSysCacheOid(SysCacheIdentifier cacheId,
AttrNumber oidcol, AttrNumber oidcol,
Datum key1, Datum key1,
Datum key2, Datum key2,
@ -592,7 +592,7 @@ SearchSysCacheCopyAttNum(Oid relid, int16 attnum)
* a different cache for the same catalog the tuple was fetched from. * a different cache for the same catalog the tuple was fetched from.
*/ */
Datum Datum
SysCacheGetAttr(int cacheId, HeapTuple tup, SysCacheGetAttr(SysCacheIdentifier cacheId, HeapTuple tup,
AttrNumber attributeNumber, AttrNumber attributeNumber,
bool *isNull) bool *isNull)
{ {
@ -622,7 +622,7 @@ SysCacheGetAttr(int cacheId, HeapTuple tup,
* be NULL. * be NULL.
*/ */
Datum Datum
SysCacheGetAttrNotNull(int cacheId, HeapTuple tup, SysCacheGetAttrNotNull(SysCacheIdentifier cacheId, HeapTuple tup,
AttrNumber attributeNumber) AttrNumber attributeNumber)
{ {
bool isnull; bool isnull;
@ -652,7 +652,7 @@ SysCacheGetAttrNotNull(int cacheId, HeapTuple tup,
* catcache code that need to be able to compute the hash values. * catcache code that need to be able to compute the hash values.
*/ */
uint32 uint32
GetSysCacheHashValue(int cacheId, GetSysCacheHashValue(SysCacheIdentifier cacheId,
Datum key1, Datum key1,
Datum key2, Datum key2,
Datum key3, Datum key3,
@ -668,7 +668,7 @@ GetSysCacheHashValue(int cacheId,
* List-search interface * List-search interface
*/ */
struct catclist * struct catclist *
SearchSysCacheList(int cacheId, int nkeys, SearchSysCacheList(SysCacheIdentifier cacheId, int nkeys,
Datum key1, Datum key2, Datum key3) Datum key1, Datum key2, Datum key3)
{ {
if (cacheId < 0 || cacheId >= SysCacheSize || !SysCache[cacheId]) if (cacheId < 0 || cacheId >= SysCacheSize || !SysCache[cacheId])
@ -687,7 +687,7 @@ SearchSysCacheList(int cacheId, int nkeys,
* This routine is only quasi-public: it should only be used by inval.c. * This routine is only quasi-public: it should only be used by inval.c.
*/ */
void void
SysCacheInvalidate(int cacheId, uint32 hashValue) SysCacheInvalidate(SysCacheIdentifier cacheId, uint32 hashValue)
{ {
if (cacheId < 0 || cacheId >= SysCacheSize) if (cacheId < 0 || cacheId >= SysCacheSize)
elog(ERROR, "invalid cache ID: %d", cacheId); elog(ERROR, "invalid cache ID: %d", cacheId);

View file

@ -91,7 +91,7 @@ static Oid TSCurrentConfigCache = InvalidOid;
* table address as the "arg". * table address as the "arg".
*/ */
static void static void
InvalidateTSCacheCallBack(Datum arg, int cacheid, uint32 hashvalue) InvalidateTSCacheCallBack(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{ {
HTAB *hash = (HTAB *) DatumGetPointer(arg); HTAB *hash = (HTAB *) DatumGetPointer(arg);
HASH_SEQ_STATUS status; HASH_SEQ_STATUS status;

View file

@ -337,9 +337,12 @@ static bool multirange_element_has_hashing(TypeCacheEntry *typentry);
static bool multirange_element_has_extended_hashing(TypeCacheEntry *typentry); static bool multirange_element_has_extended_hashing(TypeCacheEntry *typentry);
static void cache_multirange_element_properties(TypeCacheEntry *typentry); static void cache_multirange_element_properties(TypeCacheEntry *typentry);
static void TypeCacheRelCallback(Datum arg, Oid relid); static void TypeCacheRelCallback(Datum arg, Oid relid);
static void TypeCacheTypCallback(Datum arg, int cacheid, uint32 hashvalue); static void TypeCacheTypCallback(Datum arg, SysCacheIdentifier cacheid,
static void TypeCacheOpcCallback(Datum arg, int cacheid, uint32 hashvalue); uint32 hashvalue);
static void TypeCacheConstrCallback(Datum arg, int cacheid, uint32 hashvalue); static void TypeCacheOpcCallback(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue);
static void TypeCacheConstrCallback(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue);
static void load_enum_cache_data(TypeCacheEntry *tcache); static void load_enum_cache_data(TypeCacheEntry *tcache);
static EnumItem *find_enumitem(TypeCacheEnumData *enumdata, Oid arg); static EnumItem *find_enumitem(TypeCacheEnumData *enumdata, Oid arg);
static int enum_oid_cmp(const void *left, const void *right); static int enum_oid_cmp(const void *left, const void *right);
@ -2512,7 +2515,7 @@ TypeCacheRelCallback(Datum arg, Oid relid)
* it as needing to be reloaded. * it as needing to be reloaded.
*/ */
static void static void
TypeCacheTypCallback(Datum arg, int cacheid, uint32 hashvalue) TypeCacheTypCallback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{ {
HASH_SEQ_STATUS status; HASH_SEQ_STATUS status;
TypeCacheEntry *typentry; TypeCacheEntry *typentry;
@ -2569,7 +2572,7 @@ TypeCacheTypCallback(Datum arg, int cacheid, uint32 hashvalue)
* of members are not going to get cached here. * of members are not going to get cached here.
*/ */
static void static void
TypeCacheOpcCallback(Datum arg, int cacheid, uint32 hashvalue) TypeCacheOpcCallback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{ {
HASH_SEQ_STATUS status; HASH_SEQ_STATUS status;
TypeCacheEntry *typentry; TypeCacheEntry *typentry;
@ -2607,7 +2610,7 @@ TypeCacheOpcCallback(Datum arg, int cacheid, uint32 hashvalue)
* approach to domain constraints. * approach to domain constraints.
*/ */
static void static void
TypeCacheConstrCallback(Datum arg, int cacheid, uint32 hashvalue) TypeCacheConstrCallback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{ {
TypeCacheEntry *typentry; TypeCacheEntry *typentry;

View file

@ -36,7 +36,8 @@ static Oid last_roleid = InvalidOid; /* InvalidOid == cache not valid */
static bool last_roleid_is_super = false; static bool last_roleid_is_super = false;
static bool roleid_callback_registered = false; static bool roleid_callback_registered = false;
static void RoleidCallback(Datum arg, int cacheid, uint32 hashvalue); static void RoleidCallback(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue);
/* /*
@ -100,7 +101,7 @@ superuser_arg(Oid roleid)
* Syscache inval callback function * Syscache inval callback function
*/ */
static void static void
RoleidCallback(Datum arg, int cacheid, uint32 hashvalue) RoleidCallback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{ {
/* Invalidate our local cache in case role's superuserness changed */ /* Invalidate our local cache in case role's superuserness changed */
last_roleid = InvalidOid; last_roleid = InvalidOid;

View file

@ -17,6 +17,7 @@
#include "nodes/parsenodes.h" #include "nodes/parsenodes.h"
#include "storage/lockdefs.h" #include "storage/lockdefs.h"
#include "utils/relcache.h" #include "utils/relcache.h"
#include "utils/syscache.h"
/* /*
* An ObjectAddress represents a database object of any type. * An ObjectAddress represents a database object of any type.
@ -57,8 +58,8 @@ extern Oid get_object_namespace(const ObjectAddress *address);
extern bool is_objectclass_supported(Oid class_id); extern bool is_objectclass_supported(Oid class_id);
extern const char *get_object_class_descr(Oid class_id); extern const char *get_object_class_descr(Oid class_id);
extern Oid get_object_oid_index(Oid class_id); extern Oid get_object_oid_index(Oid class_id);
extern int get_object_catcache_oid(Oid class_id); extern SysCacheIdentifier get_object_catcache_oid(Oid class_id);
extern int get_object_catcache_name(Oid class_id); extern SysCacheIdentifier get_object_catcache_name(Oid class_id);
extern AttrNumber get_object_attnum_oid(Oid class_id); extern AttrNumber get_object_attnum_oid(Oid class_id);
extern AttrNumber get_object_attnum_name(Oid class_id); extern AttrNumber get_object_attnum_name(Oid class_id);
extern AttrNumber get_object_attnum_namespace(Oid class_id); extern AttrNumber get_object_attnum_namespace(Oid class_id);

View file

@ -289,7 +289,8 @@ extern void ProcessSyncingTablesForApply(XLogRecPtr current_lsn);
extern void ProcessSequencesForSync(void); extern void ProcessSequencesForSync(void);
pg_noreturn extern void FinishSyncWorker(void); pg_noreturn extern void FinishSyncWorker(void);
extern void InvalidateSyncingRelStates(Datum arg, int cacheid, uint32 hashvalue); extern void InvalidateSyncingRelStates(Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue);
extern void launch_sync_worker(LogicalRepWorkerType wtype, int nsyncworkers, extern void launch_sync_worker(LogicalRepWorkerType wtype, int nsyncworkers,
Oid relid, TimestampTz *last_start_time); Oid relid, TimestampTz *last_start_time);
extern void ProcessSyncingRelations(XLogRecPtr current_lsn); extern void ProcessSyncingRelations(XLogRecPtr current_lsn);

View file

@ -17,6 +17,7 @@
#include "access/htup.h" #include "access/htup.h"
#include "storage/relfilelocator.h" #include "storage/relfilelocator.h"
#include "utils/relcache.h" #include "utils/relcache.h"
#include "utils/syscache.h"
extern PGDLLIMPORT int debug_discard_caches; extern PGDLLIMPORT int debug_discard_caches;
@ -38,7 +39,8 @@ extern PGDLLIMPORT int debug_discard_caches;
#endif /* not DISCARD_CACHES_ENABLED */ #endif /* not DISCARD_CACHES_ENABLED */
typedef void (*SyscacheCallbackFunction) (Datum arg, int cacheid, uint32 hashvalue); typedef void (*SyscacheCallbackFunction) (Datum arg, SysCacheIdentifier cacheid,
uint32 hashvalue);
typedef void (*RelcacheCallbackFunction) (Datum arg, Oid relid); typedef void (*RelcacheCallbackFunction) (Datum arg, Oid relid);
typedef void (*RelSyncCallbackFunction) (Datum arg, Oid relid); typedef void (*RelSyncCallbackFunction) (Datum arg, Oid relid);
@ -81,7 +83,7 @@ extern void CacheInvalidateSmgr(RelFileLocatorBackend rlocator);
extern void CacheInvalidateRelmap(Oid databaseId); extern void CacheInvalidateRelmap(Oid databaseId);
extern void CacheRegisterSyscacheCallback(int cacheid, extern void CacheRegisterSyscacheCallback(SysCacheIdentifier cacheid,
SyscacheCallbackFunction func, SyscacheCallbackFunction func,
Datum arg); Datum arg);
@ -91,7 +93,7 @@ extern void CacheRegisterRelcacheCallback(RelcacheCallbackFunction func,
extern void CacheRegisterRelSyncCallback(RelSyncCallbackFunction func, extern void CacheRegisterRelSyncCallback(RelSyncCallbackFunction func,
Datum arg); Datum arg);
extern void CallSyscacheCallbacks(int cacheid, uint32 hashvalue); extern void CallSyscacheCallbacks(SysCacheIdentifier cacheid, uint32 hashvalue);
extern void CallRelSyncCallbacks(Oid relid); extern void CallRelSyncCallbacks(Oid relid);

View file

@ -25,35 +25,35 @@
extern void InitCatalogCache(void); extern void InitCatalogCache(void);
extern void InitCatalogCachePhase2(void); extern void InitCatalogCachePhase2(void);
extern HeapTuple SearchSysCache(int cacheId, extern HeapTuple SearchSysCache(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3, Datum key4); Datum key1, Datum key2, Datum key3, Datum key4);
/* /*
* The use of argument specific numbers is encouraged. They're faster, and * The use of argument specific numbers is encouraged. They're faster, and
* insulates the caller from changes in the maximum number of keys. * insulates the caller from changes in the maximum number of keys.
*/ */
extern HeapTuple SearchSysCache1(int cacheId, extern HeapTuple SearchSysCache1(SysCacheIdentifier cacheId,
Datum key1); Datum key1);
extern HeapTuple SearchSysCache2(int cacheId, extern HeapTuple SearchSysCache2(SysCacheIdentifier cacheId,
Datum key1, Datum key2); Datum key1, Datum key2);
extern HeapTuple SearchSysCache3(int cacheId, extern HeapTuple SearchSysCache3(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3); Datum key1, Datum key2, Datum key3);
extern HeapTuple SearchSysCache4(int cacheId, extern HeapTuple SearchSysCache4(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3, Datum key4); Datum key1, Datum key2, Datum key3, Datum key4);
extern void ReleaseSysCache(HeapTuple tuple); extern void ReleaseSysCache(HeapTuple tuple);
extern HeapTuple SearchSysCacheLocked1(int cacheId, extern HeapTuple SearchSysCacheLocked1(SysCacheIdentifier cacheId,
Datum key1); Datum key1);
/* convenience routines */ /* convenience routines */
extern HeapTuple SearchSysCacheCopy(int cacheId, extern HeapTuple SearchSysCacheCopy(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3, Datum key4); Datum key1, Datum key2, Datum key3, Datum key4);
extern HeapTuple SearchSysCacheLockedCopy1(int cacheId, extern HeapTuple SearchSysCacheLockedCopy1(SysCacheIdentifier cacheId,
Datum key1); Datum key1);
extern bool SearchSysCacheExists(int cacheId, extern bool SearchSysCacheExists(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3, Datum key4); Datum key1, Datum key2, Datum key3, Datum key4);
extern Oid GetSysCacheOid(int cacheId, AttrNumber oidcol, extern Oid GetSysCacheOid(SysCacheIdentifier cacheId, AttrNumber oidcol,
Datum key1, Datum key2, Datum key3, Datum key4); Datum key1, Datum key2, Datum key3, Datum key4);
extern HeapTuple SearchSysCacheAttName(Oid relid, const char *attname); extern HeapTuple SearchSysCacheAttName(Oid relid, const char *attname);
@ -63,21 +63,21 @@ extern bool SearchSysCacheExistsAttName(Oid relid, const char *attname);
extern HeapTuple SearchSysCacheAttNum(Oid relid, int16 attnum); extern HeapTuple SearchSysCacheAttNum(Oid relid, int16 attnum);
extern HeapTuple SearchSysCacheCopyAttNum(Oid relid, int16 attnum); extern HeapTuple SearchSysCacheCopyAttNum(Oid relid, int16 attnum);
extern Datum SysCacheGetAttr(int cacheId, HeapTuple tup, extern Datum SysCacheGetAttr(SysCacheIdentifier cacheId, HeapTuple tup,
AttrNumber attributeNumber, bool *isNull); AttrNumber attributeNumber, bool *isNull);
extern Datum SysCacheGetAttrNotNull(int cacheId, HeapTuple tup, extern Datum SysCacheGetAttrNotNull(SysCacheIdentifier cacheId, HeapTuple tup,
AttrNumber attributeNumber); AttrNumber attributeNumber);
extern uint32 GetSysCacheHashValue(int cacheId, extern uint32 GetSysCacheHashValue(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3, Datum key4); Datum key1, Datum key2, Datum key3, Datum key4);
/* list-search interface. Users of this must import catcache.h too */ /* list-search interface. Users of this must import catcache.h too */
struct catclist; struct catclist;
extern struct catclist *SearchSysCacheList(int cacheId, int nkeys, extern struct catclist *SearchSysCacheList(SysCacheIdentifier cacheId, int nkeys,
Datum key1, Datum key2, Datum key3); Datum key1, Datum key2, Datum key3);
extern void SysCacheInvalidate(int cacheId, uint32 hashValue); extern void SysCacheInvalidate(SysCacheIdentifier cacheId, uint32 hashValue);
extern bool RelationInvalidatesSnapshotsOnly(Oid relid); extern bool RelationInvalidatesSnapshotsOnly(Oid relid);
extern bool RelationHasSysCache(Oid relid); extern bool RelationHasSysCache(Oid relid);