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"
76 #define KEY(...) VA_ARGS_NARGS(__VA_ARGS__), { __VA_ARGS__ }
78 #include "catalog/syscache_info.h"
81 "SysCacheSize does not match syscache.c's array");
115 for (cacheId = 0; cacheId < SysCacheSize; cacheId++)
126 cacheinfo[cacheId].reloid,
127 cacheinfo[cacheId].indoid,
128 cacheinfo[cacheId].nkeys,
129 cacheinfo[cacheId].
key,
130 cacheinfo[cacheId].nbuckets);
132 elog(
ERROR,
"could not initialize cache %u (%d)",
133 cacheinfo[cacheId].reloid, cacheId);
136 cacheinfo[cacheId].reloid;
138 cacheinfo[cacheId].reloid;
140 cacheinfo[cacheId].indoid;
183 for (cacheId = 0; cacheId < SysCacheSize; cacheId++)
211 Assert(cacheId >= 0 && cacheId < SysCacheSize &&
221 Assert(cacheId >= 0 && cacheId < SysCacheSize &&
232 Assert(cacheId >= 0 && cacheId < SysCacheSize &&
243 Assert(cacheId >= 0 && cacheId < SysCacheSize &&
254 Assert(cacheId >= 0 && cacheId < SysCacheSize &&
489 if (cacheId < 0 || cacheId >= SysCacheSize ||
491 elog(
ERROR,
"invalid cache ID: %d", cacheId);
521 "unexpected null value in cached tuple for catalog %s column %s",
546 if (cacheId < 0 || cacheId >= SysCacheSize ||
548 elog(
ERROR,
"invalid cache ID: %d", cacheId);
560 if (cacheId < 0 || cacheId >= SysCacheSize ||
562 elog(
ERROR,
"invalid cache ID: %d", cacheId);
579 if (cacheId < 0 || cacheId >= SysCacheSize)
580 elog(
ERROR,
"invalid cache ID: %d", cacheId);
605 case DbRoleSettingRelationId:
606 case DependRelationId:
607 case SharedDependRelationId:
608 case DescriptionRelationId:
609 case SharedDescriptionRelationId:
610 case SecLabelRelationId:
611 case SharedSecLabelRelationId:
631 int middle = low + (high - low) / 2;
656 int middle = low + (high - low) / 2;
#define PointerIsValid(pointer)
#define OidIsValid(objectId)
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)
uint32 GetCatCacheHashValue(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4)
HeapTuple SearchCatCache4(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4)
CatCache * InitCatCache(int id, Oid reloid, Oid indexoid, int nkeys, const int *key, int nbuckets)
CatCList * SearchCatCacheList(CatCache *cache, int nkeys, Datum v1, Datum v2, Datum v3)
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)
HeapTuple heap_copytuple(HeapTuple tuple)
#define HeapTupleIsValid(tuple)
static Datum heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
static int pg_cmp_u32(uint32 a, uint32 b)
Assert(fmt[strlen(fmt) - 1] !='\n')
char * get_rel_name(Oid relid)
FormData_pg_attribute * Form_pg_attribute
#define qsort(a, b, c, d)
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)
bool RelationHasSysCache(Oid relid)
HeapTuple SearchSysCacheCopyAttNum(Oid relid, int16 attnum)
void InitCatalogCache(void)
void ReleaseSysCache(HeapTuple tuple)
static bool CacheInitialized
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)
struct catclist * SearchSysCacheList(int cacheId, int nkeys, Datum key1, Datum key2, Datum key3)
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)
#define TupleDescAttr(tupdesc, i)