PostgreSQL Source Code  git master
syscache.h File Reference
#include "access/attnum.h"
#include "access/htup.h"
Include dependency graph for syscache.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SysCacheSize   (USERMAPPINGUSERSERVER + 1)
 
#define SearchSysCacheCopy1(cacheId, key1)   SearchSysCacheCopy(cacheId, key1, 0, 0, 0)
 
#define SearchSysCacheCopy2(cacheId, key1, key2)   SearchSysCacheCopy(cacheId, key1, key2, 0, 0)
 
#define SearchSysCacheCopy3(cacheId, key1, key2, key3)   SearchSysCacheCopy(cacheId, key1, key2, key3, 0)
 
#define SearchSysCacheCopy4(cacheId, key1, key2, key3, key4)   SearchSysCacheCopy(cacheId, key1, key2, key3, key4)
 
#define SearchSysCacheExists1(cacheId, key1)   SearchSysCacheExists(cacheId, key1, 0, 0, 0)
 
#define SearchSysCacheExists2(cacheId, key1, key2)   SearchSysCacheExists(cacheId, key1, key2, 0, 0)
 
#define SearchSysCacheExists3(cacheId, key1, key2, key3)   SearchSysCacheExists(cacheId, key1, key2, key3, 0)
 
#define SearchSysCacheExists4(cacheId, key1, key2, key3, key4)   SearchSysCacheExists(cacheId, key1, key2, key3, key4)
 
#define GetSysCacheOid1(cacheId, oidcol, key1)   GetSysCacheOid(cacheId, oidcol, key1, 0, 0, 0)
 
#define GetSysCacheOid2(cacheId, oidcol, key1, key2)   GetSysCacheOid(cacheId, oidcol, key1, key2, 0, 0)
 
#define GetSysCacheOid3(cacheId, oidcol, key1, key2, key3)   GetSysCacheOid(cacheId, oidcol, key1, key2, key3, 0)
 
#define GetSysCacheOid4(cacheId, oidcol, key1, key2, key3, key4)   GetSysCacheOid(cacheId, oidcol, key1, key2, key3, key4)
 
#define GetSysCacheHashValue1(cacheId, key1)   GetSysCacheHashValue(cacheId, key1, 0, 0, 0)
 
#define GetSysCacheHashValue2(cacheId, key1, key2)   GetSysCacheHashValue(cacheId, key1, key2, 0, 0)
 
#define GetSysCacheHashValue3(cacheId, key1, key2, key3)   GetSysCacheHashValue(cacheId, key1, key2, key3, 0)
 
#define GetSysCacheHashValue4(cacheId, key1, key2, key3, key4)   GetSysCacheHashValue(cacheId, key1, key2, key3, key4)
 
#define SearchSysCacheList1(cacheId, key1)   SearchSysCacheList(cacheId, 1, key1, 0, 0)
 
#define SearchSysCacheList2(cacheId, key1, key2)   SearchSysCacheList(cacheId, 2, key1, key2, 0)
 
#define SearchSysCacheList3(cacheId, key1, key2, key3)   SearchSysCacheList(cacheId, 3, key1, key2, key3)
 
#define ReleaseSysCacheList(x)   ReleaseCatCacheList(x)
 

Enumerations

enum  SysCacheIdentifier {
  AGGFNOID = 0, AMNAME, AMOID, AMOPOPID,
  AMOPSTRATEGY, AMPROCNUM, ATTNAME, ATTNUM,
  AUTHMEMMEMROLE, AUTHMEMROLEMEM, AUTHNAME, AUTHOID,
  CASTSOURCETARGET, CLAAMNAMENSP, CLAOID, COLLNAMEENCNSP,
  COLLOID, CONDEFAULT, CONNAMENSP, CONSTROID,
  CONVOID, DATABASEOID, DEFACLROLENSPOBJ, ENUMOID,
  ENUMTYPOIDNAME, EVENTTRIGGERNAME, EVENTTRIGGEROID, FOREIGNDATAWRAPPERNAME,
  FOREIGNDATAWRAPPEROID, FOREIGNSERVERNAME, FOREIGNSERVEROID, FOREIGNTABLEREL,
  INDEXRELID, LANGNAME, LANGOID, NAMESPACENAME,
  NAMESPACEOID, OPERNAMENSP, OPEROID, OPFAMILYAMNAMENSP,
  OPFAMILYOID, PARTRELID, PROCNAMEARGSNSP, PROCOID,
  PUBLICATIONNAME, PUBLICATIONOID, PUBLICATIONREL, PUBLICATIONRELMAP,
  RANGETYPE, RELNAMENSP, RELOID, REPLORIGIDENT,
  REPLORIGNAME, RULERELNAME, SEQRELID, STATEXTDATASTXOID,
  STATEXTNAMENSP, STATEXTOID, STATRELATTINH, SUBSCRIPTIONNAME,
  SUBSCRIPTIONOID, SUBSCRIPTIONRELMAP, TABLESPACEOID, TRFOID,
  TRFTYPELANG, TSCONFIGMAP, TSCONFIGNAMENSP, TSCONFIGOID,
  TSDICTNAMENSP, TSDICTOID, TSPARSERNAMENSP, TSPARSEROID,
  TSTEMPLATENAMENSP, TSTEMPLATEOID, TYPENAMENSP, TYPEOID,
  USERMAPPINGOID
}
 

Functions

void InitCatalogCache (void)
 
void InitCatalogCachePhase2 (void)
 
HeapTuple SearchSysCache (int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
 
HeapTuple SearchSysCache1 (int cacheId, Datum key1)
 
HeapTuple SearchSysCache2 (int cacheId, Datum key1, Datum key2)
 
HeapTuple SearchSysCache3 (int cacheId, Datum key1, Datum key2, Datum key3)
 
HeapTuple SearchSysCache4 (int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
 
void ReleaseSysCache (HeapTuple tuple)
 
HeapTuple SearchSysCacheCopy (int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
 
bool SearchSysCacheExists (int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
 
Oid GetSysCacheOid (int cacheId, AttrNumber oidcol, Datum key1, Datum key2, Datum key3, Datum key4)
 
HeapTuple SearchSysCacheAttName (Oid relid, const char *attname)
 
HeapTuple SearchSysCacheCopyAttName (Oid relid, const char *attname)
 
bool SearchSysCacheExistsAttName (Oid relid, const char *attname)
 
HeapTuple SearchSysCacheAttNum (Oid relid, int16 attnum)
 
HeapTuple SearchSysCacheCopyAttNum (Oid relid, int16 attnum)
 
Datum SysCacheGetAttr (int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
 
uint32 GetSysCacheHashValue (int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
 
struct catclistSearchSysCacheList (int cacheId, int nkeys, Datum key1, Datum key2, Datum key3)
 
void SysCacheInvalidate (int cacheId, uint32 hashValue)
 
bool RelationInvalidatesSnapshotsOnly (Oid relid)
 
bool RelationHasSysCache (Oid relid)
 
bool RelationSupportsSysCache (Oid relid)
 

Macro Definition Documentation

◆ GetSysCacheHashValue1

#define GetSysCacheHashValue1 (   cacheId,
  key1 
)    GetSysCacheHashValue(cacheId, key1, 0, 0, 0)

◆ GetSysCacheHashValue2

#define GetSysCacheHashValue2 (   cacheId,
  key1,
  key2 
)    GetSysCacheHashValue(cacheId, key1, key2, 0, 0)

Definition at line 203 of file syscache.h.

◆ GetSysCacheHashValue3

#define GetSysCacheHashValue3 (   cacheId,
  key1,
  key2,
  key3 
)    GetSysCacheHashValue(cacheId, key1, key2, key3, 0)

Definition at line 205 of file syscache.h.

◆ GetSysCacheHashValue4

#define GetSysCacheHashValue4 (   cacheId,
  key1,
  key2,
  key3,
  key4 
)    GetSysCacheHashValue(cacheId, key1, key2, key3, key4)

Definition at line 207 of file syscache.h.

◆ GetSysCacheOid1

#define GetSysCacheOid1 (   cacheId,
  oidcol,
  key1 
)    GetSysCacheOid(cacheId, oidcol, key1, 0, 0, 0)

◆ GetSysCacheOid2

◆ GetSysCacheOid3

#define GetSysCacheOid3 (   cacheId,
  oidcol,
  key1,
  key2,
  key3 
)    GetSysCacheOid(cacheId, oidcol, key1, key2, key3, 0)

Definition at line 196 of file syscache.h.

Referenced by lookup_collation(), OpclassnameGetOpcid(), and OpfamilynameGetOpfid().

◆ GetSysCacheOid4

#define GetSysCacheOid4 (   cacheId,
  oidcol,
  key1,
  key2,
  key3,
  key4 
)    GetSysCacheOid(cacheId, oidcol, key1, key2, key3, key4)

Definition at line 198 of file syscache.h.

Referenced by dropOperators(), and dropProcedures().

◆ ReleaseSysCacheList

◆ SearchSysCacheCopy1

#define SearchSysCacheCopy1 (   cacheId,
  key1 
)    SearchSysCacheCopy(cacheId, key1, 0, 0, 0)

Definition at line 174 of file syscache.h.

Referenced by AlterCollation(), AlterDomainAddConstraint(), AlterDomainDefault(), AlterDomainDropConstraint(), AlterDomainNotNull(), AlterEventTrigger(), AlterEventTriggerOwner(), AlterEventTriggerOwner_oid(), AlterForeignDataWrapper(), AlterForeignDataWrapperOwner(), AlterForeignDataWrapperOwner_oid(), AlterForeignServer(), AlterForeignServerOwner(), AlterForeignServerOwner_oid(), AlterFunction(), AlterObjectNamespace_internal(), AlterOperator(), AlterPublication(), AlterPublicationOwner(), AlterPublicationOwner_oid(), AlterRelationNamespaceInternal(), AlterSequence(), AlterSubscriptionOwner_oid(), AlterTypeNamespaceInternal(), AlterTypeOwnerInternal(), AlterUserMapping(), ATExecAddColumn(), ATExecAddOf(), ATExecDetachPartition(), ATExecDisableRowSecurity(), ATExecDropOf(), ATExecEnableRowSecurity(), ATExecForceNoForceRowSecurity(), ATExecGenericOptions(), ATExecSetTableSpace(), ATExecSetTableSpaceNoStorage(), copy_table_data(), create_toast_table(), CreateTrigger(), DefineQueryRewrite(), do_autovacuum(), examine_attribute(), finish_heap_swap(), get_catalog_object_by_oid(), index_build(), index_concurrently_swap(), index_constraint_create(), index_set_state_flags(), index_update_stats(), mark_index_clustered(), OperatorCreate(), OperatorUpd(), reindex_index(), relation_mark_replica_identity(), RelationSetNewRelfilenode(), RemoveConstraintById(), RenameConstraintById(), RenameDatabase(), RenameRelationInternal(), RenameSchema(), RenameType(), RenameTypeInternal(), SetFunctionArgType(), SetFunctionReturnType(), SetMatViewPopulatedState(), SetRelationHasSubclass(), SetRelationNumChecks(), SetRelationRuleStatus(), StorePartitionBound(), swap_relation_files(), table_recheck_autovac(), update_default_partition_oid(), update_relispartition(), vac_update_datfrozenxid(), and vac_update_relstats().

◆ SearchSysCacheCopy2

#define SearchSysCacheCopy2 (   cacheId,
  key1,
  key2 
)    SearchSysCacheCopy(cacheId, key1, key2, 0, 0)

◆ SearchSysCacheCopy3

#define SearchSysCacheCopy3 (   cacheId,
  key1,
  key2,
  key3 
)    SearchSysCacheCopy(cacheId, key1, key2, key3, 0)

Definition at line 178 of file syscache.h.

◆ SearchSysCacheCopy4

#define SearchSysCacheCopy4 (   cacheId,
  key1,
  key2,
  key3,
  key4 
)    SearchSysCacheCopy(cacheId, key1, key2, key3, key4)

Definition at line 180 of file syscache.h.

◆ SearchSysCacheExists1

#define SearchSysCacheExists1 (   cacheId,
  key1 
)    SearchSysCacheExists(cacheId, key1, 0, 0, 0)

Definition at line 183 of file syscache.h.

Referenced by AlterObjectRename_internal(), check_rel_can_be_partition(), cluster_rel(), column_privilege_check(), CreateSchemaCommand(), find_expr_references_walker(), find_inheritance_children(), ForceTransactionIdLimitUpdate(), has_any_column_privilege_id(), has_any_column_privilege_id_id(), has_any_column_privilege_name_id(), has_database_privilege_id(), has_database_privilege_id_id(), has_database_privilege_name_id(), has_foreign_data_wrapper_privilege_id(), has_foreign_data_wrapper_privilege_id_id(), has_foreign_data_wrapper_privilege_name_id(), has_function_privilege_id(), has_function_privilege_id_id(), has_function_privilege_name_id(), has_language_privilege_id(), has_language_privilege_id_id(), has_language_privilege_name_id(), has_schema_privilege_id(), has_schema_privilege_id_id(), has_schema_privilege_name_id(), has_server_privilege_id(), has_server_privilege_id_id(), has_server_privilege_name_id(), has_table_privilege_id(), has_table_privilege_id_id(), has_table_privilege_name_id(), has_tablespace_privilege_id(), has_tablespace_privilege_id_id(), has_tablespace_privilege_name_id(), has_type_privilege_id(), has_type_privilege_id_id(), has_type_privilege_name_id(), lastval(), LockTableRecurse(), NamespaceCreate(), pg_collation_is_visible(), pg_conversion_is_visible(), pg_function_is_visible(), pg_ls_tmpdir(), pg_opclass_is_visible(), pg_operator_is_visible(), pg_opfamily_is_visible(), pg_statistics_obj_is_visible(), pg_table_is_visible(), pg_ts_config_is_visible(), pg_ts_dict_is_visible(), pg_ts_parser_is_visible(), pg_ts_template_is_visible(), pg_type_is_visible(), RenameRole(), shdepLockAndCheckObject(), and try_relation_open().

◆ SearchSysCacheExists2

◆ SearchSysCacheExists3

#define SearchSysCacheExists3 (   cacheId,
  key1,
  key2,
  key3 
)    SearchSysCacheExists(cacheId, key1, key2, key3, 0)

◆ SearchSysCacheExists4

#define SearchSysCacheExists4 (   cacheId,
  key1,
  key2,
  key3,
  key4 
)    SearchSysCacheExists(cacheId, key1, key2, key3, key4)

Definition at line 189 of file syscache.h.

Referenced by gistproperty(), storeOperators(), and storeProcedures().

◆ SearchSysCacheList1

◆ SearchSysCacheList2

#define SearchSysCacheList2 (   cacheId,
  key1,
  key2 
)    SearchSysCacheList(cacheId, 2, key1, key2, 0)

Definition at line 212 of file syscache.h.

Referenced by transformFrameOffset().

◆ SearchSysCacheList3

#define SearchSysCacheList3 (   cacheId,
  key1,
  key2,
  key3 
)    SearchSysCacheList(cacheId, 3, key1, key2, key3)

Definition at line 214 of file syscache.h.

Referenced by FindDefaultConversion(), and OpernameGetOprid().

◆ SysCacheSize

Enumeration Type Documentation

◆ SysCacheIdentifier

Enumerator
AGGFNOID 
AMNAME 
AMOID 
AMOPOPID 
AMOPSTRATEGY 
AMPROCNUM 
ATTNAME 
ATTNUM 
AUTHMEMMEMROLE 
AUTHMEMROLEMEM 
AUTHNAME 
AUTHOID 
CASTSOURCETARGET 
CLAAMNAMENSP 
CLAOID 
COLLNAMEENCNSP 
COLLOID 
CONDEFAULT 
CONNAMENSP 
CONSTROID 
CONVOID 
DATABASEOID 
DEFACLROLENSPOBJ 
ENUMOID 
ENUMTYPOIDNAME 
EVENTTRIGGERNAME 
EVENTTRIGGEROID 
FOREIGNDATAWRAPPERNAME 
FOREIGNDATAWRAPPEROID 
FOREIGNSERVERNAME 
FOREIGNSERVEROID 
FOREIGNTABLEREL 
INDEXRELID 
LANGNAME 
LANGOID 
NAMESPACENAME 
NAMESPACEOID 
OPERNAMENSP 
OPEROID 
OPFAMILYAMNAMENSP 
OPFAMILYOID 
PARTRELID 
PROCNAMEARGSNSP 
PROCOID 
PUBLICATIONNAME 
PUBLICATIONOID 
PUBLICATIONREL 
PUBLICATIONRELMAP 
RANGETYPE 
RELNAMENSP 
RELOID 
REPLORIGIDENT 
REPLORIGNAME 
RULERELNAME 
SEQRELID 
STATEXTDATASTXOID 
STATEXTNAMENSP 
STATEXTOID 
STATRELATTINH 
SUBSCRIPTIONNAME 
SUBSCRIPTIONOID 
SUBSCRIPTIONRELMAP 
TABLESPACEOID 
TRFOID 
TRFTYPELANG 
TSCONFIGMAP 
TSCONFIGNAMENSP 
TSCONFIGOID 
TSDICTNAMENSP 
TSDICTOID 
TSPARSERNAMENSP 
TSPARSEROID 
TSTEMPLATENAMENSP 
TSTEMPLATEOID 
TYPENAMENSP 
TYPEOID 
USERMAPPINGOID 

Definition at line 32 of file syscache.h.

33 {
34  AGGFNOID = 0,
35  AMNAME,
36  AMOID,
37  AMOPOPID,
39  AMPROCNUM,
40  ATTNAME,
41  ATTNUM,
44  AUTHNAME,
45  AUTHOID,
48  CLAOID,
50  COLLOID,
51  CONDEFAULT,
52  CONNAMENSP,
53  CONSTROID,
54  CONVOID,
57  ENUMOID,
66  INDEXRELID,
67  LANGNAME,
68  LANGOID,
72  OPEROID,
75  PARTRELID,
77  PROCOID,
82  RANGETYPE,
83  RELNAMENSP,
84  RELOID,
88  SEQRELID,
91  STATEXTOID,
97  TRFOID,
101  TSCONFIGOID,
103  TSDICTOID,
105  TSPARSEROID,
108  TYPENAMENSP,
109  TYPEOID,
111  USERMAPPINGUSERSERVER
112 
113 #define SysCacheSize (USERMAPPINGUSERSERVER + 1)
114 };
Definition: syscache.h:36

Function Documentation

◆ GetSysCacheHashValue()

uint32 GetSysCacheHashValue ( int  cacheId,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)

Definition at line 1420 of file syscache.c.

References elog, ERROR, GetCatCacheHashValue(), PointerIsValid, and SysCacheSize.

1425 {
1426  if (cacheId < 0 || cacheId >= SysCacheSize ||
1427  !PointerIsValid(SysCache[cacheId]))
1428  elog(ERROR, "invalid cache ID: %d", cacheId);
1429 
1430  return GetCatCacheHashValue(SysCache[cacheId], key1, key2, key3, key4);
1431 }
#define SysCacheSize
Definition: syscache.h:113
#define ERROR
Definition: elog.h:43
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:986
#define elog(elevel,...)
Definition: elog.h:226
uint32 GetCatCacheHashValue(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4)
Definition: catcache.c:1472
#define PointerIsValid(pointer)
Definition: c.h:626

◆ GetSysCacheOid()

Oid GetSysCacheOid ( int  cacheId,
AttrNumber  oidcol,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)

Definition at line 1233 of file syscache.c.

References Assert, heap_getattr, HeapTupleIsValid, InvalidOid, ReleaseSysCache(), and SearchSysCache().

1239 {
1240  HeapTuple tuple;
1241  bool isNull;
1242  Oid result;
1243 
1244  tuple = SearchSysCache(cacheId, key1, key2, key3, key4);
1245  if (!HeapTupleIsValid(tuple))
1246  return InvalidOid;
1247  result = heap_getattr(tuple, oidcol,
1248  SysCache[cacheId]->cc_tupdesc,
1249  &isNull);
1250  Assert(!isNull); /* columns used as oids should never be NULL */
1251  ReleaseSysCache(tuple);
1252  return result;
1253 }
HeapTuple SearchSysCache(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
Definition: syscache.c:1111
unsigned int Oid
Definition: postgres_ext.h:31
#define heap_getattr(tup, attnum, tupleDesc, isnull)
Definition: htup_details.h:762
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:986
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1172
#define InvalidOid
Definition: postgres_ext.h:36
#define HeapTupleIsValid(tuple)
Definition: htup.h:78
#define Assert(condition)
Definition: c.h:732

◆ InitCatalogCache()

void InitCatalogCache ( void  )

Definition at line 1010 of file syscache.c.

References Assert, CacheInitialized, elog, ERROR, i, cachedesc::indoid, InitCatCache(), cachedesc::key, lengthof, cachedesc::nbuckets, cachedesc::nkeys, oid_compare(), pg_qsort(), PointerIsValid, RelationInvalidatesSnapshotsOnly(), cachedesc::reloid, StaticAssertStmt, SysCacheRelationOid, SysCacheRelationOidSize, SysCacheSize, SysCacheSupportingRelOid, and SysCacheSupportingRelOidSize.

Referenced by InitPostgres().

1011 {
1012  int cacheId;
1013  int i,
1014  j;
1015 
1017  "SysCacheSize does not match syscache.c's array");
1018 
1020 
1022 
1023  for (cacheId = 0; cacheId < SysCacheSize; cacheId++)
1024  {
1025  SysCache[cacheId] = InitCatCache(cacheId,
1026  cacheinfo[cacheId].reloid,
1027  cacheinfo[cacheId].indoid,
1028  cacheinfo[cacheId].nkeys,
1029  cacheinfo[cacheId].key,
1030  cacheinfo[cacheId].nbuckets);
1031  if (!PointerIsValid(SysCache[cacheId]))
1032  elog(ERROR, "could not initialize cache %u (%d)",
1033  cacheinfo[cacheId].reloid, cacheId);
1034  /* Accumulate data for OID lists, too */
1036  cacheinfo[cacheId].reloid;
1038  cacheinfo[cacheId].reloid;
1040  cacheinfo[cacheId].indoid;
1041  /* see comments for RelationInvalidatesSnapshotsOnly */
1043  }
1044 
1047 
1048  /* Sort and de-dup OID arrays, so we can use binary search. */
1050  sizeof(Oid), oid_compare);
1051  for (i = 1, j = 0; i < SysCacheRelationOidSize; i++)
1052  {
1055  }
1056  SysCacheRelationOidSize = j + 1;
1057 
1059  sizeof(Oid), oid_compare);
1060  for (i = 1, j = 0; i < SysCacheSupportingRelOidSize; i++)
1061  {
1064  }
1065  SysCacheSupportingRelOidSize = j + 1;
1066 
1067  CacheInitialized = true;
1068 }
static bool CacheInitialized
Definition: syscache.c:988
static int SysCacheSupportingRelOidSize
Definition: syscache.c:996
static Oid SysCacheSupportingRelOid[SysCacheSize *2]
Definition: syscache.c:995
static int SysCacheRelationOidSize
Definition: syscache.c:992
#define lengthof(array)
Definition: c.h:662
unsigned int Oid
Definition: postgres_ext.h:31
static const struct cachedesc cacheinfo[]
Definition: syscache.c:124
Oid reloid
Definition: syscache.c:117
#define StaticAssertStmt(condition, errmessage)
Definition: c.h:842
#define SysCacheSize
Definition: syscache.h:113
#define ERROR
Definition: elog.h:43
CatCache * InitCatCache(int id, Oid reloid, Oid indexoid, int nkeys, const int *key, int nbuckets)
Definition: catcache.c:763
Oid indoid
Definition: syscache.c:118
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:986
static Oid SysCacheRelationOid[SysCacheSize]
Definition: syscache.c:991
#define Assert(condition)
Definition: c.h:732
bool RelationInvalidatesSnapshotsOnly(Oid relid)
Definition: syscache.c:1481
void pg_qsort(void *base, size_t nel, size_t elsize, int(*cmp)(const void *, const void *))
Definition: qsort.c:113
static int oid_compare(const void *a, const void *b)
Definition: syscache.c:1554
#define elog(elevel,...)
Definition: elog.h:226
int i
#define PointerIsValid(pointer)
Definition: c.h:626

◆ InitCatalogCachePhase2()

void InitCatalogCachePhase2 ( void  )

Definition at line 1083 of file syscache.c.

References Assert, CacheInitialized, InitCatCachePhase2(), and SysCacheSize.

Referenced by RelationCacheInitializePhase3().

1084 {
1085  int cacheId;
1086 
1088 
1089  for (cacheId = 0; cacheId < SysCacheSize; cacheId++)
1090  InitCatCachePhase2(SysCache[cacheId], true);
1091 }
static bool CacheInitialized
Definition: syscache.c:988
#define SysCacheSize
Definition: syscache.h:113
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:986
#define Assert(condition)
Definition: c.h:732
void InitCatCachePhase2(CatCache *cache, bool touch_index)
Definition: catcache.c:1032

◆ RelationHasSysCache()

bool RelationHasSysCache ( Oid  relid)

Definition at line 1504 of file syscache.c.

References SysCacheRelationOid, and SysCacheRelationOidSize.

Referenced by GetNonHistoricCatalogSnapshot().

1505 {
1506  int low = 0,
1507  high = SysCacheRelationOidSize - 1;
1508 
1509  while (low <= high)
1510  {
1511  int middle = low + (high - low) / 2;
1512 
1513  if (SysCacheRelationOid[middle] == relid)
1514  return true;
1515  if (SysCacheRelationOid[middle] < relid)
1516  low = middle + 1;
1517  else
1518  high = middle - 1;
1519  }
1520 
1521  return false;
1522 }
static int SysCacheRelationOidSize
Definition: syscache.c:992
static Oid SysCacheRelationOid[SysCacheSize]
Definition: syscache.c:991

◆ RelationInvalidatesSnapshotsOnly()

bool RelationInvalidatesSnapshotsOnly ( Oid  relid)

Definition at line 1481 of file syscache.c.

Referenced by CacheInvalidateHeapTuple(), GetNonHistoricCatalogSnapshot(), and InitCatalogCache().

1482 {
1483  switch (relid)
1484  {
1485  case DbRoleSettingRelationId:
1486  case DependRelationId:
1487  case SharedDependRelationId:
1488  case DescriptionRelationId:
1489  case SharedDescriptionRelationId:
1490  case SecLabelRelationId:
1491  case SharedSecLabelRelationId:
1492  return true;
1493  default:
1494  break;
1495  }
1496 
1497  return false;
1498 }

◆ RelationSupportsSysCache()

bool RelationSupportsSysCache ( Oid  relid)

Definition at line 1529 of file syscache.c.

References SysCacheSupportingRelOid, and SysCacheSupportingRelOidSize.

Referenced by RelationIdIsInInitFile().

1530 {
1531  int low = 0,
1532  high = SysCacheSupportingRelOidSize - 1;
1533 
1534  while (low <= high)
1535  {
1536  int middle = low + (high - low) / 2;
1537 
1538  if (SysCacheSupportingRelOid[middle] == relid)
1539  return true;
1540  if (SysCacheSupportingRelOid[middle] < relid)
1541  low = middle + 1;
1542  else
1543  high = middle - 1;
1544  }
1545 
1546  return false;
1547 }
static int SysCacheSupportingRelOidSize
Definition: syscache.c:996
static Oid SysCacheSupportingRelOid[SysCacheSize *2]
Definition: syscache.c:995

◆ ReleaseSysCache()

void ReleaseSysCache ( HeapTuple  tuple)

Definition at line 1172 of file syscache.c.

References ReleaseCatCache().

Referenced by aclitemout(), add_cast_to(), add_function_cost(), AddEnumLabel(), AddRoleMems(), AggregateCreate(), AlterDomainValidateConstraint(), AlterEnum(), AlterObjectRename_internal(), AlterOpFamily(), AlterRole(), AlterRoleSet(), AlterSchemaOwner(), AlterSchemaOwner_oid(), AlterTSConfiguration(), AlterTSDictionary(), AlterTypeOwner(), AlterTypeOwner_oid(), amvalidate(), appendAggOrderBy(), appendFunctionName(), assignOperTypes(), assignProcTypes(), ATAddForeignKeyConstraint(), ATDetachCheckNoForeignKeyRefs(), ATExecAddColumn(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecChangeOwner(), ATExecCheckNotNull(), ATExecDetachPartition(), ATExecDropColumn(), ATExecDropNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATPostAlterTypeCleanup(), ATPrepAlterColumnType(), blvalidate(), brincostestimate(), brinvalidate(), btcostestimate(), btvalidate(), build_coercion_expression(), CacheInvalidateRelcacheByRelid(), call_pltcl_start_proc(), CallStmtResultDesc(), check_amop_signature(), check_amproc_signature(), check_enable_rls(), check_for_column_name_collision(), check_hash_func_signature(), check_object_ownership(), check_role(), check_session_authorization(), check_sql_fn_statements(), check_TSCurrentConfig(), CheckFunctionValidatorAccess(), CheckIndexCompatible(), CheckMyDatabase(), CloneFkReferenced(), CloneFkReferencing(), cluster(), cluster_rel(), coerce_type(), CollationIsVisible(), column_privilege_check(), compatible_oper(), compatible_oper_opid(), compile_plperl_function(), compile_pltcl_function(), compute_return_type(), ComputeIndexAttrs(), ComputePartitionAttrs(), ConstraintSetParentConstraint(), ConstructTupleDescriptor(), ConversionIsVisible(), convert_column_name(), create_proc_lang(), CreateCast(), CreateFunction(), CreateRole(), CreateSchemaCommand(), CreateStatistics(), CreateTransform(), DefineCollation(), DefineDomain(), DefineIndex(), DefineOpClass(), DefineTSConfiguration(), DefineType(), DeleteRelationTuple(), DeleteSequenceTuple(), DelRoleMems(), deparseOpExpr(), deparseScalarArrayOpExpr(), do_autovacuum(), do_compile(), do_setval(), dropdb(), DropProceduralLanguageById(), DropRole(), DropSubscription(), enum_cmp_internal(), enum_in(), enum_out(), enum_recv(), enum_send(), errdatatype(), eval_const_expressions_mutator(), examine_simple_variable(), examine_variable(), exec_stmt_call(), ExecGrant_Attribute(), ExecGrant_Database(), ExecGrant_Fdw(), ExecGrant_ForeignServer(), ExecGrant_Function(), ExecGrant_Language(), ExecGrant_Namespace(), ExecGrant_Relation(), ExecGrant_Tablespace(), ExecGrant_Type(), ExecHashBuildSkewHash(), ExecInitAgg(), ExecuteCallStmt(), ExecuteDoStmt(), expand_all_col_privileges(), expand_vacuum_rel(), fetch_agg_sort_op(), fetch_fp_info(), find_coercion_pathway(), find_typmod_coercion_function(), fixup_whole_row_references(), flatten_reloptions(), fmgr_c_validator(), fmgr_info_cxt_security(), fmgr_info_other_lang(), fmgr_internal_validator(), fmgr_security_definer(), fmgr_sql_validator(), fmgr_symbol(), format_operator_internal(), format_operator_parts(), format_procedure_internal(), format_procedure_parts(), format_type_extended(), func_get_detail(), func_parallel(), func_strict(), func_volatile(), FuncNameAsType(), FunctionIsVisible(), generate_collation_name(), generate_function_name(), generate_operator_clause(), generate_operator_name(), generate_partition_qual(), generate_qualified_relation_name(), generate_qualified_type_name(), generate_relation_name(), generateClonedExtStatsStmt(), generateClonedIndexStmt(), get_agg_clause_costs_walker(), get_am_name(), get_am_type_oid(), get_array_type(), get_attavgwidth(), get_attgenerated(), get_attname(), get_attnum(), get_attribute_options(), get_attstatsslot(), get_atttype(), get_atttypetypmodcoll(), get_base_element_type(), get_collation(), get_collation_isdeterministic(), get_collation_name(), get_commutator(), get_constraint_name(), get_database_name(), get_db_info(), get_default_acl_internal(), get_default_partition_oid(), get_element_type(), get_func_leakproof(), get_func_name(), get_func_namespace(), get_func_nargs(), get_func_prokind(), get_func_result_name(), get_func_retset(), get_func_rettype(), get_func_signature(), get_func_support(), get_func_variadictype(), get_function_rows(), get_index_column_opclass(), get_language_name(), get_namespace_name(), get_negator(), get_object_address_defacl(), get_object_address_opf_member(), get_object_address_type(), get_object_address_usermapping(), get_object_namespace(), get_op_opfamily_properties(), get_op_opfamily_sortfamily(), get_op_opfamily_strategy(), get_op_rettype(), get_opclass(), get_opclass_family(), get_opclass_input_type(), get_opclass_name(), get_opclass_oid(), get_opclass_opfamily_and_input_type(), get_opcode(), get_oper_expr(), get_opfamily_member(), get_opfamily_oid(), get_opfamily_proc(), get_opname(), get_oprjoin(), get_oprrest(), get_publication_name(), get_qual_for_range(), get_range_subtype(), get_rel_name(), get_rel_namespace(), get_rel_persistence(), get_rel_relispartition(), get_rel_relkind(), get_rel_tablespace(), get_rel_type_id(), get_relation_statistics(), get_relname_relid(), get_rewrite_oid(), get_role_password(), get_rolespec_name(), get_rte_attribute_is_dropped(), get_rte_attribute_type(), get_subscription_name(), get_tablespace(), get_transform_fromsql(), get_transform_tosql(), get_typ_typrelid(), get_typbyval(), get_typcollation(), get_typdefault(), get_type_category_preferred(), get_type_io_data(), get_typisdefined(), get_typlen(), get_typlenbyval(), get_typlenbyvalalign(), get_typmodin(), get_typstorage(), get_typtype(), getBaseTypeAndTypmod(), GetFdwRoutineByServerId(), GetForeignColumnOptions(), GetForeignDataWrapperExtended(), GetForeignServerExtended(), GetForeignServerIdByRelId(), GetForeignTable(), GetIndexAmRoutineByAmId(), getObjectDescription(), getObjectIdentityParts(), getOpFamilyDescription(), getOpFamilyIdentity(), getProcedureTypeDescription(), GetPublication(), getRelationDescription(), getRelationIdentity(), GetRelationPublicationActions(), getRelationTypeDescription(), GetSubscription(), GetSubscriptionRelState(), GetSysCacheOid(), getTypeBinaryInputInfo(), getTypeBinaryOutputInfo(), getTypeInputInfo(), getTypeOutputInfo(), GetUserMapping(), GetUserNameFromId(), ginvalidate(), gistvalidate(), has_bypassrls_privilege(), has_createrole_privilege(), has_rolinherit(), has_rolreplication(), has_subclass(), hash_ok_operator(), hashvalidate(), have_createdb_privilege(), heap_drop_with_catalog(), inclusion_get_strategy_procinfo(), index_check_primary_key(), index_concurrently_create_copy(), index_drop(), index_get_partition(), indexam_property(), IndexGetRelation(), IndexSupportsBackwardScan(), init_sql_fcache(), initialize_peragg(), InitializeSessionUserId(), inline_set_returning_function(), InsertRule(), internal_get_result_type(), interpret_function_parameter_list(), IsBinaryCoercible(), load_domaintype_info(), load_rangetype_info(), logicalrep_write_tuple(), logicalrep_write_typ(), lookup_collation(), lookup_collation_cache(), lookup_ts_config_cache(), lookup_ts_dictionary_cache(), lookup_ts_parser_cache(), lookup_type_cache(), LookupTypeNameOid(), make_inh_translation_list(), make_new_heap(), make_op(), make_scalar_array_op(), map_sql_table_to_xmlschema(), map_sql_type_to_xml_name(), mark_index_clustered(), minmax_get_strategy_procinfo(), nextval_internal(), op_hashjoinable(), op_input_types(), op_mergejoinable(), OpclassIsVisible(), OperatorGet(), OperatorIsVisible(), OpernameGetOprid(), OpfamilyIsVisible(), ParseFuncOrColumn(), parseTypeString(), pg_attribute_aclcheck_all(), pg_attribute_aclmask(), pg_class_aclmask(), pg_class_ownercheck(), pg_collation_actual_version(), pg_collation_ownercheck(), pg_conversion_ownercheck(), pg_database_aclmask(), pg_database_ownercheck(), pg_event_trigger_ownercheck(), pg_foreign_data_wrapper_aclmask(), pg_foreign_data_wrapper_ownercheck(), pg_foreign_server_aclmask(), pg_foreign_server_ownercheck(), pg_get_constraintdef_worker(), pg_get_function_arg_default(), pg_get_function_arguments(), pg_get_function_identity_arguments(), pg_get_function_result(), pg_get_functiondef(), pg_get_indexdef_worker(), pg_get_partkeydef_worker(), pg_get_statisticsobj_worker(), pg_get_userbyid(), pg_language_aclmask(), pg_language_ownercheck(), pg_namespace_aclmask(), pg_namespace_ownercheck(), pg_newlocale_from_collation(), pg_nextoid(), pg_opclass_ownercheck(), pg_oper_ownercheck(), pg_opfamily_ownercheck(), pg_proc_aclmask(), pg_proc_ownercheck(), pg_publication_ownercheck(), pg_relation_filenode(), pg_relation_filepath(), pg_relation_is_publishable(), pg_sequence_parameters(), pg_statistics_object_ownercheck(), pg_subscription_ownercheck(), pg_tablespace_aclmask(), pg_tablespace_ownercheck(), pg_ts_config_ownercheck(), pg_ts_dict_ownercheck(), pg_type_aclmask(), pg_type_ownercheck(), pgfdw_reject_incomplete_xact_state_change(), plperl_validator(), plpgsql_build_datatype(), plpgsql_compile(), plpgsql_parse_cwordtype(), plpgsql_parse_wordtype(), plpgsql_validator(), plpython_validator(), PLy_procedure_create(), PLy_procedure_get(), prepare_column_cache(), print_function_arguments(), ProcedureCreate(), RangeVarCallbackForAlterRelation(), RangeVarCallbackForAttachIndex(), RangeVarCallbackForDropRelation(), RangeVarCallbackForPolicy(), RangeVarCallbackForRenameAttribute(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RangeVarCallbackForTruncate(), RangeVarCallbackOwnsRelation(), recomputeNamespacePath(), recordExtObjInitPriv(), refresh_by_match_merge(), regclassout(), regconfigout(), regdictionaryout(), regoperout(), regprocout(), regtypeout(), relation_mark_replica_identity(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationCacheInitializePhase3(), RelationClearMissing(), relationHasPrimaryKey(), RelationHasUnloggedIndex(), RelationInitIndexAccessInfo(), RelationInitTableAccessMethod(), RelationIsVisible(), RelationReloadIndexInfo(), RemoveAccessMethodById(), RemoveConstraintById(), RemoveEventTriggerById(), removeExtObjInitPriv(), RemoveForeignDataWrapperById(), RemoveForeignServerById(), RemoveFunctionById(), RemoveOpClassById(), RemoveOperatorById(), RemoveOpFamilyById(), RemovePartitionKeyByRelId(), RemovePublicationById(), RemovePublicationRelById(), RemoveSchemaById(), RemoveStatisticsById(), RemoveTSConfigurationById(), RemoveTSDictionaryById(), RemoveTSParserById(), RemoveTSTemplateById(), RemoveTypeById(), RemoveUserMappingById(), rename_constraint_internal(), RenameConstraint(), RenameRole(), replorigin_by_name(), replorigin_by_oid(), replorigin_drop(), ResetSequence(), ResolveOpClass(), ri_GenerateQualCollation(), ri_LoadConstraintInfo(), SearchSysCacheAttName(), SearchSysCacheAttNum(), SearchSysCacheCopy(), SearchSysCacheCopyAttName(), SearchSysCacheCopyAttNum(), SearchSysCacheExists(), SearchSysCacheExistsAttName(), sepgsql_proc_setattr(), sepgsql_relation_setattr(), sequence_options(), SetAttrMissing(), SetDefaultACL(), simplify_function(), spgvalidate(), SPI_gettype(), statext_dependencies_load(), statext_mcv_load(), statext_ndistinct_load(), statext_store(), StatisticsObjIsVisible(), superuser_arg(), transformColumnDefinition(), transformColumnNameList(), transformColumnType(), transformContainerType(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformOfType(), triggered_change_notification(), tryAttachPartitionForeignKey(), TryReuseForeignKey(), TSConfigIsVisible(), TSDictionaryIsVisible(), TSParserIsVisible(), TSTemplateIsVisible(), TupleDescInitEntry(), typeidTypeRelid(), typeIsOfTypedTable(), TypeIsVisible(), typenameTypeId(), typenameTypeIdAndMod(), typeOrDomainTypeRelid(), update_attstats(), UpdateStatisticsForTypeChange(), validatePartitionedIndex(), and verify_dictoptions().

1173 {
1174  ReleaseCatCache(tuple);
1175 }
void ReleaseCatCache(HeapTuple tuple)
Definition: catcache.c:1440

◆ SearchSysCache()

HeapTuple SearchSysCache ( int  cacheId,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)

Definition at line 1111 of file syscache.c.

References Assert, PointerIsValid, SearchCatCache(), and SysCacheSize.

Referenced by GetSysCacheOid(), SearchSysCacheCopy(), and SearchSysCacheExists().

1116 {
1117  Assert(cacheId >= 0 && cacheId < SysCacheSize &&
1118  PointerIsValid(SysCache[cacheId]));
1119 
1120  return SearchCatCache(SysCache[cacheId], key1, key2, key3, key4);
1121 }
#define SysCacheSize
Definition: syscache.h:113
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:986
#define Assert(condition)
Definition: c.h:732
HeapTuple SearchCatCache(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4)
Definition: catcache.c:1147
#define PointerIsValid(pointer)
Definition: c.h:626

◆ SearchSysCache1()

HeapTuple SearchSysCache1 ( int  cacheId,
Datum  key1 
)

Definition at line 1124 of file syscache.c.

References Assert, PointerIsValid, SearchCatCache1(), and SysCacheSize.

Referenced by aclitemout(), add_cast_to(), add_function_cost(), AggregateCreate(), AlterDomainValidateConstraint(), AlterEnum(), AlterObjectRename_internal(), AlterOpFamily(), AlterSchemaOwner(), AlterSchemaOwner_oid(), AlterTSDictionary(), AlterTypeOwner_oid(), amvalidate(), appendAggOrderBy(), appendFunctionName(), assignOperTypes(), assignProcTypes(), ATAddForeignKeyConstraint(), ATDetachCheckNoForeignKeyRefs(), ATExecAlterColumnGenericOptions(), ATExecChangeOwner(), ATExecDetachPartition(), ATExecDropNotNull(), ATExecSetRelOptions(), ATPostAlterTypeCleanup(), blvalidate(), brinvalidate(), btvalidate(), build_coercion_expression(), CacheInvalidateRelcacheByRelid(), call_pltcl_start_proc(), CallStmtResultDesc(), check_amop_signature(), check_amproc_signature(), check_enable_rls(), check_hash_func_signature(), check_object_ownership(), check_role(), check_session_authorization(), check_sql_fn_statements(), check_TSCurrentConfig(), CheckFunctionValidatorAccess(), CheckIndexCompatible(), CheckMyDatabase(), CloneFkReferenced(), CloneFkReferencing(), cluster(), cluster_rel(), CollationIsVisible(), compile_plperl_function(), compile_pltcl_function(), ComputeIndexAttrs(), ConstraintSetParentConstraint(), ConstructTupleDescriptor(), ConversionIsVisible(), create_proc_lang(), CreateCast(), CreateEventTrigger(), CreateFunction(), CreateSchemaCommand(), CreateTransform(), DefineCollation(), DefineIndex(), DefineOpClass(), DefineTSConfiguration(), DeleteRelationTuple(), DeleteSequenceTuple(), deparseOpExpr(), deparseScalarArrayOpExpr(), do_autovacuum(), do_compile(), do_setval(), dropdb(), DropProceduralLanguageById(), DropRole(), enum_cmp_internal(), enum_out(), enum_send(), errdatatype(), eval_const_expressions_mutator(), exec_stmt_call(), ExecGrant_Database(), ExecGrant_Fdw(), ExecGrant_ForeignServer(), ExecGrant_Function(), ExecGrant_Language(), ExecGrant_Namespace(), ExecGrant_Relation(), ExecGrant_Tablespace(), ExecGrant_Type(), ExecInitAgg(), ExecuteCallStmt(), ExecuteDoStmt(), expand_vacuum_rel(), fetch_agg_sort_op(), fetch_fp_info(), fixup_whole_row_references(), flatten_reloptions(), fmgr_c_validator(), fmgr_info_cxt_security(), fmgr_info_other_lang(), fmgr_internal_validator(), fmgr_security_definer(), fmgr_sql_validator(), fmgr_symbol(), format_operator_internal(), format_operator_parts(), format_procedure_internal(), format_procedure_parts(), format_type_extended(), func_get_detail(), func_parallel(), func_strict(), func_volatile(), FunctionIsVisible(), generate_collation_name(), generate_function_name(), generate_operator_clause(), generate_operator_name(), generate_partition_qual(), generate_qualified_relation_name(), generate_qualified_type_name(), generate_relation_name(), generateClonedExtStatsStmt(), generateClonedIndexStmt(), get_agg_clause_costs_walker(), get_am_name(), get_am_type_oid(), get_array_type(), get_attstatsslot(), get_base_element_type(), get_collation(), get_collation_isdeterministic(), get_collation_name(), get_commutator(), get_constraint_name(), get_database_name(), get_db_info(), get_default_partition_oid(), get_element_type(), get_func_leakproof(), get_func_name(), get_func_namespace(), get_func_nargs(), get_func_prokind(), get_func_result_name(), get_func_retset(), get_func_rettype(), get_func_signature(), get_func_support(), get_func_variadictype(), get_function_rows(), get_index_column_opclass(), get_language_name(), get_namespace_name(), get_negator(), get_object_address_defacl(), get_object_address_usermapping(), get_object_namespace(), get_op_rettype(), get_opclass(), get_opclass_family(), get_opclass_input_type(), get_opclass_name(), get_opclass_opfamily_and_input_type(), get_opcode(), get_oper_expr(), get_opname(), get_oprjoin(), get_oprrest(), get_publication_name(), get_qual_for_range(), get_range_subtype(), get_rel_name(), get_rel_namespace(), get_rel_persistence(), get_rel_relispartition(), get_rel_relkind(), get_rel_tablespace(), get_rel_type_id(), get_relation_statistics(), get_relname_relid(), get_role_password(), get_rolespec_tuple(), get_subscription_name(), get_tablespace(), get_typ_typrelid(), get_typbyval(), get_typcollation(), get_typdefault(), get_type_category_preferred(), get_type_io_data(), get_typisdefined(), get_typlen(), get_typlenbyval(), get_typlenbyvalalign(), get_typmodin(), get_typstorage(), get_typtype(), getBaseTypeAndTypmod(), GetFdwRoutineByServerId(), GetForeignDataWrapperExtended(), GetForeignServerExtended(), GetForeignServerIdByRelId(), GetForeignTable(), GetIndexAmRoutineByAmId(), getObjectDescription(), getObjectIdentityParts(), getOpFamilyDescription(), getOpFamilyIdentity(), getProcedureTypeDescription(), GetPublication(), getRelationDescription(), getRelationIdentity(), GetRelationPublicationActions(), getRelationTypeDescription(), GetSubscription(), GetTSConfigTuple(), getTypeBinaryInputInfo(), getTypeBinaryOutputInfo(), getTypeInputInfo(), getTypeOutputInfo(), GetUserNameFromId(), ginvalidate(), gistvalidate(), has_bypassrls_privilege(), has_createrole_privilege(), has_rolinherit(), has_rolreplication(), has_subclass(), hash_ok_operator(), hashvalidate(), have_createdb_privilege(), heap_drop_with_catalog(), index_concurrently_create_copy(), index_drop(), index_get_partition(), indexam_property(), IndexGetRelation(), IndexSupportsBackwardScan(), init_sql_fcache(), initialize_peragg(), InitializeSessionUserId(), inline_set_returning_function(), internal_get_result_type(), left_oper(), load_domaintype_info(), load_rangetype_info(), logicalrep_write_tuple(), logicalrep_write_typ(), lookup_collation_cache(), lookup_ts_config_cache(), lookup_ts_dictionary_cache(), lookup_ts_parser_cache(), lookup_type_cache(), LookupTypeNameExtended(), make_new_heap(), map_sql_table_to_xmlschema(), map_sql_type_to_xml_name(), mark_index_clustered(), nextval_internal(), op_hashjoinable(), op_input_types(), op_mergejoinable(), OpClassCacheLookup(), OpclassIsVisible(), oper(), OperatorIsVisible(), OpFamilyCacheLookup(), OpfamilyIsVisible(), ParseFuncOrColumn(), pg_attribute_aclcheck_all(), pg_attribute_aclmask(), pg_class_aclmask(), pg_class_ownercheck(), pg_collation_actual_version(), pg_collation_ownercheck(), pg_conversion_ownercheck(), pg_database_aclmask(), pg_database_ownercheck(), pg_event_trigger_ownercheck(), pg_foreign_data_wrapper_aclmask(), pg_foreign_data_wrapper_ownercheck(), pg_foreign_server_aclmask(), pg_foreign_server_ownercheck(), pg_get_constraintdef_worker(), pg_get_function_arg_default(), pg_get_function_arguments(), pg_get_function_identity_arguments(), pg_get_function_result(), pg_get_functiondef(), pg_get_indexdef_worker(), pg_get_partkeydef_worker(), pg_get_statisticsobj_worker(), pg_get_userbyid(), pg_language_aclmask(), pg_language_ownercheck(), pg_namespace_aclmask(), pg_namespace_ownercheck(), pg_newlocale_from_collation(), pg_opclass_ownercheck(), pg_oper_ownercheck(), pg_opfamily_ownercheck(), pg_proc_aclmask(), pg_proc_ownercheck(), pg_publication_ownercheck(), pg_relation_filenode(), pg_relation_filepath(), pg_relation_is_publishable(), pg_sequence_parameters(), pg_statistics_object_ownercheck(), pg_subscription_ownercheck(), pg_tablespace_aclmask(), pg_tablespace_ownercheck(), pg_ts_config_ownercheck(), pg_ts_dict_ownercheck(), pg_type_aclmask(), pg_type_ownercheck(), pgfdw_reject_incomplete_xact_state_change(), plperl_validator(), plpgsql_build_datatype(), plpgsql_compile(), plpgsql_parse_cwordtype(), plpgsql_validator(), plpython_validator(), PLy_procedure_create(), PLy_procedure_get(), prepare_column_cache(), print_function_arguments(), RangeVarCallbackForAlterRelation(), RangeVarCallbackForAttachIndex(), RangeVarCallbackForDropRelation(), RangeVarCallbackForPolicy(), RangeVarCallbackForRenameAttribute(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RangeVarCallbackForTruncate(), RangeVarCallbackOwnsRelation(), recomputeNamespacePath(), recordExtObjInitPriv(), refresh_by_match_merge(), regclassout(), regconfigout(), regdictionaryout(), regoperout(), regprocout(), regtypeout(), relation_mark_replica_identity(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationCacheInitializePhase3(), relationHasPrimaryKey(), RelationHasUnloggedIndex(), RelationInitIndexAccessInfo(), RelationInitTableAccessMethod(), RelationIsVisible(), RelationReloadIndexInfo(), RemoveAccessMethodById(), RemoveConstraintById(), RemoveEventTriggerById(), removeExtObjInitPriv(), RemoveForeignDataWrapperById(), RemoveForeignServerById(), RemoveFunctionById(), RemoveOpClassById(), RemoveOperatorById(), RemoveOpFamilyById(), RemovePartitionKeyByRelId(), RemovePublicationById(), RemovePublicationRelById(), RemoveSchemaById(), RemoveStatisticsById(), RemoveTSConfigurationById(), RemoveTSDictionaryById(), RemoveTSParserById(), RemoveTSTemplateById(), RemoveTypeById(), RemoveUserMappingById(), rename_constraint_internal(), RenameConstraint(), RenameRole(), replorigin_by_name(), replorigin_by_oid(), replorigin_drop(), ResetSequence(), ResolveOpClass(), ri_GenerateQualCollation(), ri_LoadConstraintInfo(), right_oper(), sepgsql_proc_setattr(), sepgsql_relation_setattr(), sequence_options(), simplify_function(), spgvalidate(), SPI_gettype(), statext_dependencies_load(), statext_mcv_load(), statext_ndistinct_load(), statext_store(), StatisticsObjIsVisible(), superuser_arg(), transformContainerType(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), triggered_change_notification(), tryAttachPartitionForeignKey(), TryReuseForeignKey(), TSConfigIsVisible(), TSDictionaryIsVisible(), TSParserIsVisible(), TSTemplateIsVisible(), TupleDescInitEntry(), typeidType(), typeidTypeRelid(), typeIsOfTypedTable(), TypeIsVisible(), typeOrDomainTypeRelid(), UpdateStatisticsForTypeChange(), validatePartitionedIndex(), and verify_dictoptions().

1126 {
1127  Assert(cacheId >= 0 && cacheId < SysCacheSize &&
1128  PointerIsValid(SysCache[cacheId]));
1129  Assert(SysCache[cacheId]->cc_nkeys == 1);
1130 
1131  return SearchCatCache1(SysCache[cacheId], key1);
1132 }
#define SysCacheSize
Definition: syscache.h:113
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:986
#define Assert(condition)
Definition: c.h:732
#define PointerIsValid(pointer)
Definition: c.h:626
HeapTuple SearchCatCache1(CatCache *cache, Datum v1)
Definition: catcache.c:1164

◆ SearchSysCache2()

HeapTuple SearchSysCache2 ( int  cacheId,
Datum  key1,
Datum  key2 
)

Definition at line 1135 of file syscache.c.

References Assert, PointerIsValid, SearchCatCache2(), and SysCacheSize.

Referenced by AddEnumLabel(), AddRoleMems(), check_for_column_name_collision(), column_privilege_check(), convert_column_name(), CreateCast(), CreateTransform(), DelRoleMems(), DropSubscription(), enum_in(), enum_recv(), ExecGrant_Attribute(), expand_all_col_privileges(), find_coercion_pathway(), find_typmod_coercion_function(), fixup_whole_row_references(), get_attgenerated(), get_attname(), get_attribute_options(), get_atttype(), get_atttypetypmodcoll(), get_object_address_usermapping(), get_rewrite_oid(), get_rte_attribute_is_dropped(), get_rte_attribute_type(), get_transform_fromsql(), get_transform_tosql(), GetForeignColumnOptions(), GetSubscriptionRelState(), GetUserMapping(), index_check_primary_key(), InsertRule(), IsBinaryCoercible(), pg_attribute_aclcheck_all(), pg_attribute_aclmask(), recordExtObjInitPriv(), RelationClearMissing(), removeExtObjInitPriv(), SearchSysCacheAttName(), and SearchSysCacheAttNum().

1137 {
1138  Assert(cacheId >= 0 && cacheId < SysCacheSize &&
1139  PointerIsValid(SysCache[cacheId]));
1140  Assert(SysCache[cacheId]->cc_nkeys == 2);
1141 
1142  return SearchCatCache2(SysCache[cacheId], key1, key2);
1143 }
#define SysCacheSize
Definition: syscache.h:113
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:986
#define Assert(condition)
Definition: c.h:732
#define PointerIsValid(pointer)
Definition: c.h:626
HeapTuple SearchCatCache2(CatCache *cache, Datum v1, Datum v2)
Definition: catcache.c:1172

◆ SearchSysCache3()

HeapTuple SearchSysCache3 ( int  cacheId,
Datum  key1,
Datum  key2,
Datum  key3 
)

Definition at line 1146 of file syscache.c.

References Assert, PointerIsValid, SearchCatCache3(), and SysCacheSize.

Referenced by brincostestimate(), btcostestimate(), DefineOpClass(), examine_simple_variable(), examine_variable(), ExecHashBuildSkewHash(), get_attavgwidth(), get_default_acl_internal(), get_object_address_defacl(), get_op_opfamily_properties(), get_op_opfamily_sortfamily(), get_op_opfamily_strategy(), lookup_collation(), OpClassCacheLookup(), OpFamilyCacheLookup(), ProcedureCreate(), ResolveOpClass(), SetDefaultACL(), and update_attstats().

1148 {
1149  Assert(cacheId >= 0 && cacheId < SysCacheSize &&
1150  PointerIsValid(SysCache[cacheId]));
1151  Assert(SysCache[cacheId]->cc_nkeys == 3);
1152 
1153  return SearchCatCache3(SysCache[cacheId], key1, key2, key3);
1154 }
#define SysCacheSize
Definition: syscache.h:113
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:986
#define Assert(condition)
Definition: c.h:732
HeapTuple SearchCatCache3(CatCache *cache, Datum v1, Datum v2, Datum v3)
Definition: catcache.c:1180
#define PointerIsValid(pointer)
Definition: c.h:626

◆ SearchSysCache4()

HeapTuple SearchSysCache4 ( int  cacheId,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)

Definition at line 1157 of file syscache.c.

References Assert, PointerIsValid, SearchCatCache4(), and SysCacheSize.

Referenced by get_object_address_opf_member(), get_opfamily_member(), get_opfamily_proc(), inclusion_get_strategy_procinfo(), minmax_get_strategy_procinfo(), OperatorGet(), and OpernameGetOprid().

1159 {
1160  Assert(cacheId >= 0 && cacheId < SysCacheSize &&
1161  PointerIsValid(SysCache[cacheId]));
1162  Assert(SysCache[cacheId]->cc_nkeys == 4);
1163 
1164  return SearchCatCache4(SysCache[cacheId], key1, key2, key3, key4);
1165 }
#define SysCacheSize
Definition: syscache.h:113
HeapTuple SearchCatCache4(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4)
Definition: catcache.c:1188
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:986
#define Assert(condition)
Definition: c.h:732
#define PointerIsValid(pointer)
Definition: c.h:626

◆ SearchSysCacheAttName()

HeapTuple SearchSysCacheAttName ( Oid  relid,
const char *  attname 
)

Definition at line 1265 of file syscache.c.

References ATTNAME, CStringGetDatum, GETSTRUCT, HeapTupleIsValid, ObjectIdGetDatum, ReleaseSysCache(), and SearchSysCache2().

Referenced by ATExecAlterColumnGenericOptions(), ATExecCheckNotNull(), ATExecDropColumn(), ATExecSetOptions(), ATPrepAlterColumnType(), ComputeIndexAttrs(), ComputePartitionAttrs(), CreateStatistics(), get_attnum(), make_inh_translation_list(), pg_nextoid(), plpgsql_parse_cwordtype(), SearchSysCacheCopyAttName(), SearchSysCacheExistsAttName(), SetAttrMissing(), and transformColumnNameList().

1266 {
1267  HeapTuple tuple;
1268 
1269  tuple = SearchSysCache2(ATTNAME,
1270  ObjectIdGetDatum(relid),
1272  if (!HeapTupleIsValid(tuple))
1273  return NULL;
1274  if (((Form_pg_attribute) GETSTRUCT(tuple))->attisdropped)
1275  {
1276  ReleaseSysCache(tuple);
1277  return NULL;
1278  }
1279  return tuple;
1280 }
#define GETSTRUCT(TUP)
Definition: htup_details.h:655
#define ObjectIdGetDatum(X)
Definition: postgres.h:507
NameData attname
Definition: pg_attribute.h:40
#define CStringGetDatum(X)
Definition: postgres.h:578
FormData_pg_attribute * Form_pg_attribute
Definition: pg_attribute.h:200
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1172
#define HeapTupleIsValid(tuple)
Definition: htup.h:78
HeapTuple SearchSysCache2(int cacheId, Datum key1, Datum key2)
Definition: syscache.c:1135

◆ SearchSysCacheAttNum()

HeapTuple SearchSysCacheAttNum ( Oid  relid,
int16  attnum 
)

Definition at line 1328 of file syscache.c.

References ATTNUM, GETSTRUCT, HeapTupleIsValid, Int16GetDatum, ObjectIdGetDatum, ReleaseSysCache(), and SearchSysCache2().

Referenced by SearchSysCacheCopyAttNum().

1329 {
1330  HeapTuple tuple;
1331 
1332  tuple = SearchSysCache2(ATTNUM,
1333  ObjectIdGetDatum(relid),
1335  if (!HeapTupleIsValid(tuple))
1336  return NULL;
1337  if (((Form_pg_attribute) GETSTRUCT(tuple))->attisdropped)
1338  {
1339  ReleaseSysCache(tuple);
1340  return NULL;
1341  }
1342  return tuple;
1343 }
#define GETSTRUCT(TUP)
Definition: htup_details.h:655
#define Int16GetDatum(X)
Definition: postgres.h:451
#define ObjectIdGetDatum(X)
Definition: postgres.h:507
FormData_pg_attribute * Form_pg_attribute
Definition: pg_attribute.h:200
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1172
int16 attnum
Definition: pg_attribute.h:79
#define HeapTupleIsValid(tuple)
Definition: htup.h:78
HeapTuple SearchSysCache2(int cacheId, Datum key1, Datum key2)
Definition: syscache.c:1135

◆ SearchSysCacheCopy()

HeapTuple SearchSysCacheCopy ( int  cacheId,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)

Definition at line 1186 of file syscache.c.

References heap_copytuple(), HeapTupleIsValid, ReleaseSysCache(), and SearchSysCache().

1191 {
1192  HeapTuple tuple,
1193  newtuple;
1194 
1195  tuple = SearchSysCache(cacheId, key1, key2, key3, key4);
1196  if (!HeapTupleIsValid(tuple))
1197  return tuple;
1198  newtuple = heap_copytuple(tuple);
1199  ReleaseSysCache(tuple);
1200  return newtuple;
1201 }
HeapTuple SearchSysCache(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
Definition: syscache.c:1111
HeapTuple heap_copytuple(HeapTuple tuple)
Definition: heaptuple.c:680
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1172
#define HeapTupleIsValid(tuple)
Definition: htup.h:78

◆ SearchSysCacheCopyAttName()

HeapTuple SearchSysCacheCopyAttName ( Oid  relid,
const char *  attname 
)

Definition at line 1288 of file syscache.c.

References heap_copytuple(), HeapTupleIsValid, ReleaseSysCache(), and SearchSysCacheAttName().

Referenced by ATExecAddColumn(), ATExecAddIdentity(), ATExecAlterColumnType(), ATExecDropColumn(), ATExecDropIdentity(), ATExecDropNotNull(), ATExecSetIdentity(), ATExecSetNotNull(), ATExecSetStatistics(), ATExecSetStorage(), MergeAttributesIntoExisting(), and renameatt_internal().

1289 {
1290  HeapTuple tuple,
1291  newtuple;
1292 
1293  tuple = SearchSysCacheAttName(relid, attname);
1294  if (!HeapTupleIsValid(tuple))
1295  return tuple;
1296  newtuple = heap_copytuple(tuple);
1297  ReleaseSysCache(tuple);
1298  return newtuple;
1299 }
HeapTuple heap_copytuple(HeapTuple tuple)
Definition: heaptuple.c:680
NameData attname
Definition: pg_attribute.h:40
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1172
#define HeapTupleIsValid(tuple)
Definition: htup.h:78
HeapTuple SearchSysCacheAttName(Oid relid, const char *attname)
Definition: syscache.c:1265

◆ SearchSysCacheCopyAttNum()

HeapTuple SearchSysCacheCopyAttNum ( Oid  relid,
int16  attnum 
)

Definition at line 1351 of file syscache.c.

References heap_copytuple(), HeapTupleIsValid, ReleaseSysCache(), and SearchSysCacheAttNum().

Referenced by ATExecSetStatistics().

1352 {
1353  HeapTuple tuple,
1354  newtuple;
1355 
1356  tuple = SearchSysCacheAttNum(relid, attnum);
1357  if (!HeapTupleIsValid(tuple))
1358  return NULL;
1359  newtuple = heap_copytuple(tuple);
1360  ReleaseSysCache(tuple);
1361  return newtuple;
1362 }
HeapTuple heap_copytuple(HeapTuple tuple)
Definition: heaptuple.c:680
HeapTuple SearchSysCacheAttNum(Oid relid, int16 attnum)
Definition: syscache.c:1328
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1172
int16 attnum
Definition: pg_attribute.h:79
#define HeapTupleIsValid(tuple)
Definition: htup.h:78

◆ SearchSysCacheExists()

bool SearchSysCacheExists ( int  cacheId,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)

Definition at line 1210 of file syscache.c.

References HeapTupleIsValid, ReleaseSysCache(), and SearchSysCache().

1215 {
1216  HeapTuple tuple;
1217 
1218  tuple = SearchSysCache(cacheId, key1, key2, key3, key4);
1219  if (!HeapTupleIsValid(tuple))
1220  return false;
1221  ReleaseSysCache(tuple);
1222  return true;
1223 }
HeapTuple SearchSysCache(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
Definition: syscache.c:1111
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1172
#define HeapTupleIsValid(tuple)
Definition: htup.h:78

◆ SearchSysCacheExistsAttName()

bool SearchSysCacheExistsAttName ( Oid  relid,
const char *  attname 
)

Definition at line 1307 of file syscache.c.

References HeapTupleIsValid, ReleaseSysCache(), and SearchSysCacheAttName().

Referenced by RemoveInheritance().

1308 {
1309  HeapTuple tuple;
1310 
1311  tuple = SearchSysCacheAttName(relid, attname);
1312  if (!HeapTupleIsValid(tuple))
1313  return false;
1314  ReleaseSysCache(tuple);
1315  return true;
1316 }
NameData attname
Definition: pg_attribute.h:40
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1172
#define HeapTupleIsValid(tuple)
Definition: htup.h:78
HeapTuple SearchSysCacheAttName(Oid relid, const char *attname)
Definition: syscache.c:1265

◆ SearchSysCacheList()

struct catclist* SearchSysCacheList ( int  cacheId,
int  nkeys,
Datum  key1,
Datum  key2,
Datum  key3 
)

Definition at line 1437 of file syscache.c.

References elog, ERROR, PointerIsValid, SearchCatCacheList(), and SysCacheSize.

1439 {
1440  if (cacheId < 0 || cacheId >= SysCacheSize ||
1441  !PointerIsValid(SysCache[cacheId]))
1442  elog(ERROR, "invalid cache ID: %d", cacheId);
1443 
1444  return SearchCatCacheList(SysCache[cacheId], nkeys,
1445  key1, key2, key3);
1446 }
#define SysCacheSize
Definition: syscache.h:113
#define ERROR
Definition: elog.h:43
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:986
CatCList * SearchCatCacheList(CatCache *cache, int nkeys, Datum v1, Datum v2, Datum v3)
Definition: catcache.c:1506
#define elog(elevel,...)
Definition: elog.h:226
#define PointerIsValid(pointer)
Definition: c.h:626

◆ SysCacheGetAttr()

Datum SysCacheGetAttr ( int  cacheId,
HeapTuple  tup,
AttrNumber  attributeNumber,
bool isNull 
)

Definition at line 1385 of file syscache.c.

References Assert, elog, ERROR, heap_getattr, InitCatCachePhase2(), PointerIsValid, and SysCacheSize.

Referenced by AlterCollation(), AlterDomainValidateConstraint(), AlterForeignDataWrapper(), AlterForeignServer(), AlterFunction(), AlterRole(), AlterSchemaOwner_internal(), AlterTSDictionary(), AlterUserMapping(), ATExecAlterColumnGenericOptions(), ATExecChangeOwner(), ATExecGenericOptions(), ATExecSetOptions(), ATExecSetRelOptions(), build_function_result_tupdesc_t(), build_replindex_scan_key(), CheckIndexCompatible(), compile_plperl_function(), compile_pltcl_function(), DeconstructFkConstraintRow(), DefineDomain(), do_compile(), DropSubscription(), ExecGrant_Attribute(), ExecGrant_Fdw(), ExecGrant_ForeignServer(), ExecGrant_Function(), ExecGrant_Language(), ExecGrant_Namespace(), ExecGrant_Relation(), ExecInitAgg(), fetch_function_defaults(), fetch_statentries_for_relation(), flatten_reloptions(), fmgr_c_validator(), fmgr_info_C_lang(), fmgr_info_cxt_security(), fmgr_internal_validator(), fmgr_security_definer(), fmgr_sql_validator(), fmgr_symbol(), func_get_detail(), generate_partition_qual(), generateClonedExtStatsStmt(), generateClonedIndexStmt(), get_attribute_options(), get_attstatsslot(), get_default_acl_internal(), get_func_arg_info(), get_func_result_name(), get_func_trftypes(), get_index_column_opclass(), get_object_namespace(), get_qual_for_range(), get_role_password(), get_tablespace(), get_typdefault(), GetForeignColumnOptions(), GetForeignDataWrapperExtended(), GetForeignServerExtended(), GetForeignTable(), GetSubscription(), GetSubscriptionRelState(), GetUserMapping(), inclusion_get_strategy_procinfo(), index_concurrently_create_copy(), init_sql_fcache(), initialize_peragg(), inline_function(), inline_set_returning_function(), lookup_ts_dictionary_cache(), make_new_heap(), MatchNamedCall(), minmax_get_strategy_procinfo(), pg_attribute_aclmask(), pg_class_aclmask(), pg_database_aclmask(), pg_foreign_data_wrapper_aclmask(), pg_foreign_server_aclmask(), pg_get_constraintdef_worker(), pg_get_function_arg_default(), pg_get_functiondef(), pg_get_indexdef_worker(), pg_get_partkeydef_worker(), pg_get_statisticsobj_worker(), pg_language_aclmask(), pg_namespace_aclmask(), pg_newlocale_from_collation(), pg_proc_aclmask(), pg_tablespace_aclmask(), pg_type_aclmask(), PLy_procedure_create(), prepare_sql_fn_parse_info(), print_function_arguments(), ProcedureCreate(), recordExtObjInitPriv(), refresh_by_match_merge(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), SetDefaultACL(), statext_dependencies_load(), statext_mcv_load(), statext_ndistinct_load(), StorePartitionBound(), test_indoption(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformIndexConstraint(), TryReuseForeignKey(), and validateCheckConstraint().

1388 {
1389  /*
1390  * We just need to get the TupleDesc out of the cache entry, and then we
1391  * can apply heap_getattr(). Normally the cache control data is already
1392  * valid (because the caller recently fetched the tuple via this same
1393  * cache), but there are cases where we have to initialize the cache here.
1394  */
1395  if (cacheId < 0 || cacheId >= SysCacheSize ||
1396  !PointerIsValid(SysCache[cacheId]))
1397  elog(ERROR, "invalid cache ID: %d", cacheId);
1398  if (!PointerIsValid(SysCache[cacheId]->cc_tupdesc))
1399  {
1400  InitCatCachePhase2(SysCache[cacheId], false);
1401  Assert(PointerIsValid(SysCache[cacheId]->cc_tupdesc));
1402  }
1403 
1404  return heap_getattr(tup, attributeNumber,
1405  SysCache[cacheId]->cc_tupdesc,
1406  isNull);
1407 }
#define SysCacheSize
Definition: syscache.h:113
#define ERROR
Definition: elog.h:43
#define heap_getattr(tup, attnum, tupleDesc, isnull)
Definition: htup_details.h:762
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:986
#define Assert(condition)
Definition: c.h:732
#define elog(elevel,...)
Definition: elog.h:226
void InitCatCachePhase2(CatCache *cache, bool touch_index)
Definition: catcache.c:1032
#define PointerIsValid(pointer)
Definition: c.h:626

◆ SysCacheInvalidate()

void SysCacheInvalidate ( int  cacheId,
uint32  hashValue 
)

Definition at line 1457 of file syscache.c.

References CatCacheInvalidate(), elog, ERROR, PointerIsValid, and SysCacheSize.

Referenced by LocalExecuteInvalidationMessage().

1458 {
1459  if (cacheId < 0 || cacheId >= SysCacheSize)
1460  elog(ERROR, "invalid cache ID: %d", cacheId);
1461 
1462  /* if this cache isn't initialized yet, no need to do anything */
1463  if (!PointerIsValid(SysCache[cacheId]))
1464  return;
1465 
1466  CatCacheInvalidate(SysCache[cacheId], hashValue);
1467 }
void CatCacheInvalidate(CatCache *cache, uint32 hashValue)
Definition: catcache.c:552
#define SysCacheSize
Definition: syscache.h:113
#define ERROR
Definition: elog.h:43
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:986
#define elog(elevel,...)
Definition: elog.h:226
#define PointerIsValid(pointer)
Definition: c.h:626