24#include "catalog/pg_db_role_setting_d.h"
25#include "catalog/pg_depend_d.h"
26#include "catalog/pg_description_d.h"
27#include "catalog/pg_seclabel_d.h"
28#include "catalog/pg_shdepend_d.h"
29#include "catalog/pg_shdescription_d.h"
30#include "catalog/pg_shseclabel_d.h"
79#define KEY(...) VA_ARGS_NARGS(__VA_ARGS__), { __VA_ARGS__ }
81#include "catalog/syscache_info.h"
84 "SysCacheSize does not match syscache.c's array");
118 for (cacheId = 0; cacheId < SysCacheSize; cacheId++)
129 cacheinfo[cacheId].reloid,
130 cacheinfo[cacheId].indoid,
131 cacheinfo[cacheId].nkeys,
132 cacheinfo[cacheId].
key,
133 cacheinfo[cacheId].nbuckets);
135 elog(
ERROR,
"could not initialize cache %u (%d)",
136 cacheinfo[cacheId].reloid, cacheId);
139 cacheinfo[cacheId].reloid;
141 cacheinfo[cacheId].reloid;
143 cacheinfo[cacheId].indoid;
186 for (cacheId = 0; cacheId < SysCacheSize; cacheId++)
214 Assert(cacheId >= 0 && cacheId < SysCacheSize &&
SysCache[cacheId]);
223 Assert(cacheId >= 0 && cacheId < SysCacheSize &&
SysCache[cacheId]);
233 Assert(cacheId >= 0 && cacheId < SysCacheSize &&
SysCache[cacheId]);
243 Assert(cacheId >= 0 && cacheId < SysCacheSize &&
SysCache[cacheId]);
253 Assert(cacheId >= 0 && cacheId < SysCacheSize &&
SysCache[cacheId]);
605 if (cacheId < 0 || cacheId >= SysCacheSize || !
SysCache[cacheId])
606 elog(
ERROR,
"invalid cache ID: %d", cacheId);
636 "unexpected null value in cached tuple for catalog %s column %s",
661 if (cacheId < 0 || cacheId >= SysCacheSize || !
SysCache[cacheId])
662 elog(
ERROR,
"invalid cache ID: %d", cacheId);
674 if (cacheId < 0 || cacheId >= SysCacheSize || !
SysCache[cacheId])
675 elog(
ERROR,
"invalid cache ID: %d", cacheId);
692 if (cacheId < 0 || cacheId >= SysCacheSize)
693 elog(
ERROR,
"invalid cache ID: %d", cacheId);
718 case DbRoleSettingRelationId:
719 case DependRelationId:
720 case SharedDependRelationId:
721 case DescriptionRelationId:
722 case SharedDescriptionRelationId:
723 case SecLabelRelationId:
724 case SharedSecLabelRelationId:
744 int middle = low + (high - low) / 2;
769 int middle = low + (high - low) / 2;
#define OidIsValid(objectId)
CatCache * InitCatCache(int id, Oid reloid, Oid indexoid, int nkeys, const int *key, int nbuckets)
HeapTuple SearchCatCache2(CatCache *cache, Datum v1, Datum v2)
HeapTuple SearchCatCache3(CatCache *cache, Datum v1, Datum v2, Datum v3)
void InitCatCachePhase2(CatCache *cache, bool touch_index)
CatCList * SearchCatCacheList(CatCache *cache, int nkeys, Datum v1, Datum v2, Datum v3)
uint32 GetCatCacheHashValue(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4)
HeapTuple SearchCatCache4(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4)
void CatCacheInvalidate(CatCache *cache, uint32 hashValue)
HeapTuple SearchCatCache1(CatCache *cache, Datum v1)
void ReleaseCatCache(HeapTuple tuple)
HeapTuple SearchCatCache(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4)
Assert(PointerIsAligned(start, uint64))
HeapTuple heap_copytuple(HeapTuple tuple)
#define HeapTupleIsValid(tuple)
static Datum heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
static void * GETSTRUCT(const HeapTupleData *tuple)
static int pg_cmp_u32(uint32 a, uint32 b)
void AcceptInvalidationMessages(void)
bool ItemPointerEquals(ItemPointer pointer1, ItemPointer pointer2)
static void ItemPointerSetInvalid(ItemPointerData *pointer)
static OffsetNumber ItemPointerGetOffsetNumber(const ItemPointerData *pointer)
static BlockNumber ItemPointerGetBlockNumber(const ItemPointerData *pointer)
static bool ItemPointerIsValid(const ItemPointerData *pointer)
LockAcquireResult LockAcquire(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock, bool dontWait)
bool LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock)
#define SET_LOCKTAG_TUPLE(locktag, dboid, reloid, blocknum, offnum)
#define InplaceUpdateTupleLock
char * get_rel_name(Oid relid)
FormData_pg_attribute * Form_pg_attribute
#define qsort(a, b, c, d)
static Oid DatumGetObjectId(Datum X)
static Datum Int16GetDatum(int16 X)
static Datum ObjectIdGetDatum(Oid X)
static Datum CStringGetDatum(const char *X)
static size_t qunique(void *array, size_t elements, size_t width, int(*compare)(const void *, const void *))
HeapTuple SearchSysCacheCopyAttName(Oid relid, const char *attname)
void SysCacheInvalidate(int cacheId, uint32 hashValue)
struct catclist * SearchSysCacheList(int cacheId, int nkeys, Datum key1, Datum key2, Datum key3)
bool RelationHasSysCache(Oid relid)
HeapTuple SearchSysCacheCopyAttNum(Oid relid, int16 attnum)
void InitCatalogCache(void)
void ReleaseSysCache(HeapTuple tuple)
static bool CacheInitialized
HeapTuple SearchSysCacheLocked1(int cacheId, Datum key1)
HeapTuple SearchSysCacheLockedCopy1(int cacheId, Datum key1)
static int oid_compare(const void *a, const void *b)
HeapTuple SearchSysCache(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
uint32 GetSysCacheHashValue(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
StaticAssertDecl(lengthof(cacheinfo)==SysCacheSize, "SysCacheSize does not match syscache.c's array")
HeapTuple SearchSysCache3(int cacheId, Datum key1, Datum key2, Datum key3)
static int SysCacheSupportingRelOidSize
HeapTuple SearchSysCacheAttNum(Oid relid, int16 attnum)
bool RelationSupportsSysCache(Oid relid)
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
bool SearchSysCacheExistsAttName(Oid relid, const char *attname)
void InitCatalogCachePhase2(void)
HeapTuple SearchSysCache2(int cacheId, Datum key1, Datum key2)
HeapTuple SearchSysCacheAttName(Oid relid, const char *attname)
bool SearchSysCacheExists(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
HeapTuple SearchSysCacheCopy(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
static Oid SysCacheRelationOid[SysCacheSize]
static CatCache * SysCache[SysCacheSize]
static Oid SysCacheSupportingRelOid[SysCacheSize *2]
static int SysCacheRelationOidSize
bool RelationInvalidatesSnapshotsOnly(Oid relid)
HeapTuple SearchSysCache4(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
Datum SysCacheGetAttrNotNull(int cacheId, HeapTuple tup, AttrNumber attributeNumber)
Oid GetSysCacheOid(int cacheId, AttrNumber oidcol, Datum key1, Datum key2, Datum key3, Datum key4)
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)