SubTransactionId mySubid,
SubTransactionId parentSubid,
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_reset_xact_state(ConnCacheEntry *entry, bool toplevel);
static bool pgfdw_cancel_query(PGconn *conn);
* individual option values, but it seems too much effort for the gain.
*/
static void
-pgfdw_inval_callback(Datum arg, int cacheid, uint32 hashvalue)
+pgfdw_inval_callback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{
HASH_SEQ_STATUS scan;
ConnCacheEntry *entry;
* made for them, however.
*/
static void
-InvalidateShippableCacheCallback(Datum arg, int cacheid, uint32 hashvalue)
+InvalidateShippableCacheCallback(Datum arg, SysCacheIdentifier cacheid,
+ uint32 hashvalue)
{
HASH_SEQ_STATUS status;
ShippableCacheEntry *entry;
ExecGrant_common(InternalGrant *istmt, Oid classid, AclMode default_privs,
void (*object_check) (InternalGrant *istmt, HeapTuple tuple))
{
- int cacheid;
+ SysCacheIdentifier cacheid;
Relation relation;
ListCell *cell;
AclMode mask, AclMaskHow how,
bool *is_missing)
{
- int cacheid;
+ SysCacheIdentifier cacheid;
AclMode result;
HeapTuple tuple;
Datum aclDatum;
bool
object_ownercheck(Oid classid, Oid objectid, Oid roleid)
{
- int cacheid;
+ SysCacheIdentifier cacheid;
Oid ownerId;
/* Superusers bypass all permission checking. */
/* This will error on unsupported classoid. */
else if (get_object_attnum_acl(classoid) != InvalidAttrNumber)
{
- int cacheid;
+ SysCacheIdentifier cacheid;
Datum aclDatum;
bool isNull;
HeapTuple tuple;
ScanKeyData key[3];
SysScanDesc scan;
HeapTuple oldtuple;
- int cacheid;
+ SysCacheIdentifier cacheid;
HeapTuple objtuple;
Oid ownerId;
Datum oldAclDatum;
static void
DropObjectById(const ObjectAddress *object)
{
- int cacheId;
+ SysCacheIdentifier cacheId;
Relation rel;
HeapTuple tup;
# Now generate syscache info
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";
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_info_fh "};\n";
static void InitTempTableNamespace(void);
static void RemoveTempRelations(Oid tempNamespaceId);
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,
bool include_out_arguments, int pronargs,
int **argnumbers, int *fgc_flags);
* Syscache inval callback function
*/
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
* error messages */
Oid class_oid; /* oid of catalog */
Oid oid_index_oid; /* oid of index on system oid column */
- int oid_catcache_id; /* id of catcache on system oid column */
- int name_catcache_id; /* id of catcache on (name,namespace), or
- * (name) if the object does not live in a
- * namespace */
+ SysCacheIdentifier oid_catcache_id; /* id of catcache on system oid column */
+ SysCacheIdentifier name_catcache_id; /* id of catcache on
+ * (name,namespace), or (name) if
+ * the object does not live in a
+ * namespace */
AttrNumber attnum_oid; /* attribute number of oid column */
AttrNumber attnum_name; /* attnum of name field */
AttrNumber attnum_namespace; /* attnum of namespace field */
Oid
get_object_namespace(const ObjectAddress *address)
{
- int cache;
+ SysCacheIdentifier cache;
HeapTuple tuple;
Oid oid;
const ObjectPropertyType *property;
return prop->oid_index_oid;
}
-int
+SysCacheIdentifier
get_object_catcache_oid(Oid class_id)
{
const ObjectPropertyType *prop = get_object_property_data(class_id);
return prop->oid_catcache_id;
}
-int
+SysCacheIdentifier
get_object_catcache_name(Oid class_id)
{
const ObjectPropertyType *prop = get_object_property_data(class_id);
{
HeapTuple tuple;
Oid classId = RelationGetRelid(catalog);
- int oidCacheId = get_object_catcache_oid(classId);
+ SysCacheIdentifier oidCacheId = get_object_catcache_oid(classId);
if (oidCacheId >= 0)
{
AlterObjectRename_internal(Relation rel, Oid objectId, const char *new_name)
{
Oid classId = RelationGetRelid(rel);
- int oidCacheId = get_object_catcache_oid(classId);
- int nameCacheId = get_object_catcache_name(classId);
+ SysCacheIdentifier oidCacheId = get_object_catcache_oid(classId);
+ SysCacheIdentifier nameCacheId = get_object_catcache_name(classId);
AttrNumber Anum_name = get_object_attnum_name(classId);
AttrNumber Anum_namespace = get_object_attnum_namespace(classId);
AttrNumber Anum_owner = get_object_attnum_owner(classId);
AlterObjectNamespace_internal(Relation rel, Oid objid, Oid nspOid)
{
Oid classId = RelationGetRelid(rel);
- int oidCacheId = get_object_catcache_oid(classId);
- int nameCacheId = get_object_catcache_name(classId);
+ SysCacheIdentifier oidCacheId = get_object_catcache_oid(classId);
+ SysCacheIdentifier nameCacheId = get_object_catcache_name(classId);
AttrNumber Anum_name = get_object_attnum_name(classId);
AttrNumber Anum_namespace = get_object_attnum_namespace(classId);
AttrNumber Anum_owner = get_object_attnum_owner(classId);
static ExtensionSiblingCache *ext_sibling_list = NULL;
/* 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,
ExtensionVersionInfo *evi_start,
ExtensionVersionInfo *evi_target,
* looking for, could change without an extension update or drop/recreate.
*/
static void
-ext_sibling_callback(Datum arg, int cacheid, uint32 hashvalue)
+ext_sibling_callback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{
ExtensionSiblingCache *cache_entry;
static bool operator_same_subexprs_lookup(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);
/*
* Callback for pg_amop inval events
*/
static void
-InvalidateOprProofCacheCallBack(Datum arg, int cacheid, uint32 hashvalue)
+InvalidateOprProofCacheCallBack(Datum arg, SysCacheIdentifier cacheid,
+ uint32 hashvalue)
{
HASH_SEQ_STATUS status;
OprProofCacheEntry *hentry;
int location);
static Oid find_oper_cache_entry(OprCacheKey *key);
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);
/*
* Callback for pg_operator and pg_cast inval events
*/
static void
-InvalidateOprCacheCallBack(Datum arg, int cacheid, uint32 hashvalue)
+InvalidateOprCacheCallBack(Datum arg, SysCacheIdentifier cacheid,
+ uint32 hashvalue)
{
HASH_SEQ_STATUS status;
OprCacheEntry *hentry;
* Callback from syscache invalidation.
*/
void
-InvalidateSyncingRelStates(Datum arg, int cacheid, uint32 hashvalue)
+InvalidateSyncingRelStates(Datum arg, SysCacheIdentifier cacheid,
+ uint32 hashvalue)
{
relation_states_validity = SYNC_RELATIONS_STATE_NEEDS_REBUILD;
}
* Callback from subscription syscache invalidation.
*/
static void
-subscription_change_cb(Datum arg, int cacheid, uint32 hashvalue)
+subscription_change_cb(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{
MySubscriptionValid = false;
}
static bool publications_valid;
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);
static void send_repl_origin(LogicalDecodingContext *ctx,
ReplOriginId origin_id, XLogRecPtr origin_lsn,
LogicalDecodingContext *ctx,
RelationSyncEntry *relentry);
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);
static void set_schema_sent_in_streamed_txn(RelationSyncEntry *entry,
TransactionId xid);
* Called for invalidations on pg_publication.
*/
static void
-publication_invalidation_cb(Datum arg, int cacheid, uint32 hashvalue)
+publication_invalidation_cb(Datum arg, SysCacheIdentifier cacheid,
+ uint32 hashvalue)
{
publications_valid = false;
}
* Called for invalidations on pg_namespace.
*/
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;
RelationSyncEntry *entry;
static AclMode convert_role_priv_string(text *priv_type_text);
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);
/*
* Syscache inval callback function
*/
static void
-RoleMembershipCacheCallback(Datum arg, int cacheid, uint32 hashvalue)
+RoleMembershipCacheCallback(Datum arg, SysCacheIdentifier cacheid,
+ uint32 hashvalue)
{
if (cacheid == DATABASEOID &&
hashvalue != cached_db_hash &&
Datum lhs, Datum rhs);
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 void ri_HashPreparedPlan(RI_QueryKey *key, SPIPlanPtr plan);
static RI_CompareHashEntry *ri_HashCompareOp(Oid eq_opr, Oid typeid);
* data from changing under it --- but we may get cache flushes anyway.)
*/
static void
-InvalidateConstraintCacheCallBack(Datum arg, int cacheid, uint32 hashvalue)
+InvalidateConstraintCacheCallBack(Datum arg, SysCacheIdentifier cacheid,
+ uint32 hashvalue)
{
dlist_mutable_iter iter;
* for that attribute.
*/
static void
-InvalidateAttoptCacheCallback(Datum arg, int cacheid, uint32 hashvalue)
+InvalidateAttoptCacheCallback(Datum arg, SysCacheIdentifier cacheid,
+ uint32 hashvalue)
{
HASH_SEQ_STATUS status;
AttoptCacheEntry *attopt;
static void BuildEventTriggerCache(void);
static void InvalidateEventCacheCallback(Datum arg,
- int cacheid, uint32 hashvalue);
+ SysCacheIdentifier cacheid,
+ uint32 hashvalue);
static Bitmapset *DecodeTextArrayToBitmapset(Datum array);
/*
* memory leaks.
*/
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
* flush all cached state anyway.
*/
void
-CacheRegisterSyscacheCallback(int cacheid,
+CacheRegisterSyscacheCallback(SysCacheIdentifier cacheid,
SyscacheCallbackFunction func,
Datum arg)
{
* this module from knowing which catcache IDs correspond to which catalogs.
*/
void
-CallSyscacheCallbacks(int cacheid, uint32 hashvalue)
+CallSyscacheCallbacks(SysCacheIdentifier cacheid, uint32 hashvalue)
{
int i;
static bool ScanQueryWalker(Node *node, bool *acquire);
static TupleDesc PlanCacheComputeResultDesc(List *stmt_list);
static void PlanCacheRelCallback(Datum arg, Oid relid);
-static void PlanCacheObjectCallback(Datum arg, int cacheid, uint32 hashvalue);
-static void PlanCacheSysCallback(Datum arg, int cacheid, uint32 hashvalue);
+static void PlanCacheObjectCallback(Datum arg, SysCacheIdentifier cacheid,
+ uint32 hashvalue);
+static void PlanCacheSysCallback(Datum arg, SysCacheIdentifier cacheid,
+ uint32 hashvalue);
/* ResourceOwner callbacks to track plancache references */
static void ResOwnerReleaseCachedPlan(Datum res);
* or all plans mentioning any member of this cache if hashvalue == 0.
*/
static void
-PlanCacheObjectCallback(Datum arg, int cacheid, uint32 hashvalue)
+PlanCacheObjectCallback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{
dlist_iter iter;
* Just invalidate everything...
*/
static void
-PlanCacheSysCallback(Datum arg, int cacheid, uint32 hashvalue)
+PlanCacheSysCallback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{
ResetPlanCache();
}
* tablespaces, nor do we expect them to be frequently modified.
*/
static void
-InvalidateTableSpaceCacheCallback(Datum arg, int cacheid, uint32 hashvalue)
+InvalidateTableSpaceCacheCallback(Datum arg, SysCacheIdentifier cacheid,
+ uint32 hashvalue)
{
HASH_SEQ_STATUS status;
TableSpaceCacheEntry *spc;
void
InitCatalogCache(void)
{
- int cacheId;
+ SysCacheIdentifier cacheId;
Assert(!CacheInitialized);
void
InitCatalogCachePhase2(void)
{
- int cacheId;
+ SysCacheIdentifier cacheId;
Assert(CacheInitialized);
* CAUTION: The tuple that is returned must NOT be freed by the caller!
*/
HeapTuple
-SearchSysCache(int cacheId,
+SearchSysCache(SysCacheIdentifier cacheId,
Datum key1,
Datum key2,
Datum key3,
}
HeapTuple
-SearchSysCache1(int cacheId,
+SearchSysCache1(SysCacheIdentifier cacheId,
Datum key1)
{
Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]);
}
HeapTuple
-SearchSysCache2(int cacheId,
+SearchSysCache2(SysCacheIdentifier cacheId,
Datum key1, Datum key2)
{
Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]);
}
HeapTuple
-SearchSysCache3(int cacheId,
+SearchSysCache3(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3)
{
Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]);
}
HeapTuple
-SearchSysCache4(int cacheId,
+SearchSysCache4(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3, Datum key4)
{
Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]);
* doesn't prevent the "tuple concurrently updated" error.
*/
HeapTuple
-SearchSysCacheLocked1(int cacheId,
+SearchSysCacheLocked1(SysCacheIdentifier cacheId,
Datum key1)
{
CatCache *cache = SysCache[cacheId];
* heap_freetuple() the result when done with it.
*/
HeapTuple
-SearchSysCacheCopy(int cacheId,
+SearchSysCacheCopy(SysCacheIdentifier cacheId,
Datum key1,
Datum key2,
Datum key3,
* heap_freetuple().
*/
HeapTuple
-SearchSysCacheLockedCopy1(int cacheId,
+SearchSysCacheLockedCopy1(SysCacheIdentifier cacheId,
Datum key1)
{
HeapTuple tuple,
* No lock is retained on the syscache entry.
*/
bool
-SearchSysCacheExists(int cacheId,
+SearchSysCacheExists(SysCacheIdentifier cacheId,
Datum key1,
Datum key2,
Datum key3,
* No lock is retained on the syscache entry.
*/
Oid
-GetSysCacheOid(int cacheId,
+GetSysCacheOid(SysCacheIdentifier cacheId,
AttrNumber oidcol,
Datum key1,
Datum key2,
* a different cache for the same catalog the tuple was fetched from.
*/
Datum
-SysCacheGetAttr(int cacheId, HeapTuple tup,
+SysCacheGetAttr(SysCacheIdentifier cacheId, HeapTuple tup,
AttrNumber attributeNumber,
bool *isNull)
{
* be NULL.
*/
Datum
-SysCacheGetAttrNotNull(int cacheId, HeapTuple tup,
+SysCacheGetAttrNotNull(SysCacheIdentifier cacheId, HeapTuple tup,
AttrNumber attributeNumber)
{
bool isnull;
* catcache code that need to be able to compute the hash values.
*/
uint32
-GetSysCacheHashValue(int cacheId,
+GetSysCacheHashValue(SysCacheIdentifier cacheId,
Datum key1,
Datum key2,
Datum key3,
* List-search interface
*/
struct catclist *
-SearchSysCacheList(int cacheId, int nkeys,
+SearchSysCacheList(SysCacheIdentifier cacheId, int nkeys,
Datum key1, Datum key2, Datum key3)
{
if (cacheId < 0 || cacheId >= SysCacheSize || !SysCache[cacheId])
* This routine is only quasi-public: it should only be used by inval.c.
*/
void
-SysCacheInvalidate(int cacheId, uint32 hashValue)
+SysCacheInvalidate(SysCacheIdentifier cacheId, uint32 hashValue)
{
if (cacheId < 0 || cacheId >= SysCacheSize)
elog(ERROR, "invalid cache ID: %d", cacheId);
* table address as the "arg".
*/
static void
-InvalidateTSCacheCallBack(Datum arg, int cacheid, uint32 hashvalue)
+InvalidateTSCacheCallBack(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{
HTAB *hash = (HTAB *) DatumGetPointer(arg);
HASH_SEQ_STATUS status;
static bool multirange_element_has_extended_hashing(TypeCacheEntry *typentry);
static void cache_multirange_element_properties(TypeCacheEntry *typentry);
static void TypeCacheRelCallback(Datum arg, Oid relid);
-static void TypeCacheTypCallback(Datum arg, int cacheid, uint32 hashvalue);
-static void TypeCacheOpcCallback(Datum arg, int cacheid, uint32 hashvalue);
-static void TypeCacheConstrCallback(Datum arg, int cacheid, uint32 hashvalue);
+static void TypeCacheTypCallback(Datum arg, SysCacheIdentifier 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 EnumItem *find_enumitem(TypeCacheEnumData *enumdata, Oid arg);
static int enum_oid_cmp(const void *left, const void *right);
* it as needing to be reloaded.
*/
static void
-TypeCacheTypCallback(Datum arg, int cacheid, uint32 hashvalue)
+TypeCacheTypCallback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{
HASH_SEQ_STATUS status;
TypeCacheEntry *typentry;
* of members are not going to get cached here.
*/
static void
-TypeCacheOpcCallback(Datum arg, int cacheid, uint32 hashvalue)
+TypeCacheOpcCallback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{
HASH_SEQ_STATUS status;
TypeCacheEntry *typentry;
* approach to domain constraints.
*/
static void
-TypeCacheConstrCallback(Datum arg, int cacheid, uint32 hashvalue)
+TypeCacheConstrCallback(Datum arg, SysCacheIdentifier cacheid, uint32 hashvalue)
{
TypeCacheEntry *typentry;
static bool last_roleid_is_super = 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);
/*
* Syscache inval callback function
*/
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 */
last_roleid = InvalidOid;
#include "nodes/parsenodes.h"
#include "storage/lockdefs.h"
#include "utils/relcache.h"
+#include "utils/syscache.h"
/*
* An ObjectAddress represents a database object of any type.
extern bool is_objectclass_supported(Oid class_id);
extern const char *get_object_class_descr(Oid class_id);
extern Oid get_object_oid_index(Oid class_id);
-extern int get_object_catcache_oid(Oid class_id);
-extern int get_object_catcache_name(Oid class_id);
+extern SysCacheIdentifier get_object_catcache_oid(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_name(Oid class_id);
extern AttrNumber get_object_attnum_namespace(Oid class_id);
extern void ProcessSequencesForSync(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,
Oid relid, TimestampTz *last_start_time);
extern void ProcessSyncingRelations(XLogRecPtr current_lsn);
#include "access/htup.h"
#include "storage/relfilelocator.h"
#include "utils/relcache.h"
+#include "utils/syscache.h"
extern PGDLLIMPORT int debug_discard_caches;
#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 (*RelSyncCallbackFunction) (Datum arg, Oid relid);
extern void CacheInvalidateRelmap(Oid databaseId);
-extern void CacheRegisterSyscacheCallback(int cacheid,
+extern void CacheRegisterSyscacheCallback(SysCacheIdentifier cacheid,
SyscacheCallbackFunction func,
Datum arg);
extern void CacheRegisterRelSyncCallback(RelSyncCallbackFunction func,
Datum arg);
-extern void CallSyscacheCallbacks(int cacheid, uint32 hashvalue);
+extern void CallSyscacheCallbacks(SysCacheIdentifier cacheid, uint32 hashvalue);
extern void CallRelSyncCallbacks(Oid relid);
extern void InitCatalogCache(void);
extern void InitCatalogCachePhase2(void);
-extern HeapTuple SearchSysCache(int cacheId,
+extern HeapTuple SearchSysCache(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3, Datum key4);
/*
* The use of argument specific numbers is encouraged. They're faster, and
* insulates the caller from changes in the maximum number of keys.
*/
-extern HeapTuple SearchSysCache1(int cacheId,
+extern HeapTuple SearchSysCache1(SysCacheIdentifier cacheId,
Datum key1);
-extern HeapTuple SearchSysCache2(int cacheId,
+extern HeapTuple SearchSysCache2(SysCacheIdentifier cacheId,
Datum key1, Datum key2);
-extern HeapTuple SearchSysCache3(int cacheId,
+extern HeapTuple SearchSysCache3(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3);
-extern HeapTuple SearchSysCache4(int cacheId,
+extern HeapTuple SearchSysCache4(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3, Datum key4);
extern void ReleaseSysCache(HeapTuple tuple);
-extern HeapTuple SearchSysCacheLocked1(int cacheId,
+extern HeapTuple SearchSysCacheLocked1(SysCacheIdentifier cacheId,
Datum key1);
/* convenience routines */
-extern HeapTuple SearchSysCacheCopy(int cacheId,
+extern HeapTuple SearchSysCacheCopy(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3, Datum key4);
-extern HeapTuple SearchSysCacheLockedCopy1(int cacheId,
+extern HeapTuple SearchSysCacheLockedCopy1(SysCacheIdentifier cacheId,
Datum key1);
-extern bool SearchSysCacheExists(int cacheId,
+extern bool SearchSysCacheExists(SysCacheIdentifier cacheId,
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);
extern HeapTuple SearchSysCacheAttName(Oid relid, const char *attname);
extern HeapTuple SearchSysCacheAttNum(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);
-extern Datum SysCacheGetAttrNotNull(int cacheId, HeapTuple tup,
+extern Datum SysCacheGetAttrNotNull(SysCacheIdentifier cacheId, HeapTuple tup,
AttrNumber attributeNumber);
-extern uint32 GetSysCacheHashValue(int cacheId,
+extern uint32 GetSysCacheHashValue(SysCacheIdentifier cacheId,
Datum key1, Datum key2, Datum key3, Datum key4);
/* list-search interface. Users of this must import catcache.h too */
struct catclist;
-extern struct catclist *SearchSysCacheList(int cacheId, int nkeys,
+extern struct catclist *SearchSysCacheList(SysCacheIdentifier cacheId, int nkeys,
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 RelationHasSysCache(Oid relid);