PostgreSQL Source Code git master
Loading...
Searching...
No Matches
syscache.h File Reference
#include "access/attnum.h"
#include "access/htup.h"
#include "catalog/syscache_ids.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 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)
 

Functions

void InitCatalogCache (void)
 
void InitCatalogCachePhase2 (void)
 
HeapTuple SearchSysCache (SysCacheIdentifier cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
 
HeapTuple SearchSysCache1 (SysCacheIdentifier cacheId, Datum key1)
 
HeapTuple SearchSysCache2 (SysCacheIdentifier cacheId, Datum key1, Datum key2)
 
HeapTuple SearchSysCache3 (SysCacheIdentifier cacheId, Datum key1, Datum key2, Datum key3)
 
HeapTuple SearchSysCache4 (SysCacheIdentifier cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
 
void ReleaseSysCache (HeapTuple tuple)
 
HeapTuple SearchSysCacheLocked1 (SysCacheIdentifier cacheId, Datum key1)
 
HeapTuple SearchSysCacheCopy (SysCacheIdentifier cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
 
HeapTuple SearchSysCacheLockedCopy1 (SysCacheIdentifier cacheId, Datum key1)
 
bool SearchSysCacheExists (SysCacheIdentifier cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
 
Oid GetSysCacheOid (SysCacheIdentifier 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 (SysCacheIdentifier cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
 
Datum SysCacheGetAttrNotNull (SysCacheIdentifier cacheId, HeapTuple tup, AttrNumber attributeNumber)
 
uint32 GetSysCacheHashValue (SysCacheIdentifier cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
 
struct catclistSearchSysCacheList (SysCacheIdentifier cacheId, int nkeys, Datum key1, Datum key2, Datum key3)
 
void SysCacheInvalidate (SysCacheIdentifier 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)

Definition at line 118 of file syscache.h.

◆ GetSysCacheHashValue2

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

Definition at line 120 of file syscache.h.

◆ GetSysCacheHashValue3

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

Definition at line 122 of file syscache.h.

◆ GetSysCacheHashValue4

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

Definition at line 124 of file syscache.h.

◆ GetSysCacheOid1

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

Definition at line 109 of file syscache.h.

◆ GetSysCacheOid2

#define GetSysCacheOid2 (   cacheId,
  oidcol,
  key1,
  key2 
)     GetSysCacheOid(cacheId, oidcol, key1, key2, 0, 0)

Definition at line 111 of file syscache.h.

◆ GetSysCacheOid3

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

Definition at line 113 of file syscache.h.

◆ GetSysCacheOid4

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

Definition at line 115 of file syscache.h.

◆ ReleaseSysCacheList

#define ReleaseSysCacheList (   x)    ReleaseCatCacheList(x)

Definition at line 134 of file syscache.h.

◆ SearchSysCacheCopy1

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

Definition at line 91 of file syscache.h.

◆ SearchSysCacheCopy2

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

Definition at line 93 of file syscache.h.

◆ SearchSysCacheCopy3

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

Definition at line 95 of file syscache.h.

◆ SearchSysCacheCopy4

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

Definition at line 97 of file syscache.h.

◆ SearchSysCacheExists1

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

Definition at line 100 of file syscache.h.

◆ SearchSysCacheExists2

#define SearchSysCacheExists2 (   cacheId,
  key1,
  key2 
)     SearchSysCacheExists(cacheId, key1, key2, 0, 0)

Definition at line 102 of file syscache.h.

◆ SearchSysCacheExists3

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

Definition at line 104 of file syscache.h.

◆ SearchSysCacheExists4

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

Definition at line 106 of file syscache.h.

◆ SearchSysCacheList1

#define SearchSysCacheList1 (   cacheId,
  key1 
)     SearchSysCacheList(cacheId, 1, key1, 0, 0)

Definition at line 127 of file syscache.h.

◆ SearchSysCacheList2

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

Definition at line 129 of file syscache.h.

◆ SearchSysCacheList3

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

Definition at line 131 of file syscache.h.

Function Documentation

◆ GetSysCacheHashValue()

uint32 GetSysCacheHashValue ( SysCacheIdentifier  cacheId,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)
extern

Definition at line 656 of file syscache.c.

661{
663 elog(ERROR, "invalid cache ID: %d", cacheId);
664
665 return GetCatCacheHashValue(SysCache[cacheId], key1, key2, key3, key4);
666}
uint32 GetCatCacheHashValue(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4)
Definition catcache.c:1707
#define ERROR
Definition elog.h:40
#define elog(elevel,...)
Definition elog.h:228
static int fb(int x)
static CatCache * SysCache[SysCacheSize]
Definition syscache.c:87

References elog, ERROR, fb(), GetCatCacheHashValue(), and SysCache.

◆ GetSysCacheOid()

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

Definition at line 444 of file syscache.c.

450{
451 HeapTuple tuple;
452 bool isNull;
453 Oid result;
454
455 tuple = SearchSysCache(cacheId, key1, key2, key3, key4);
456 if (!HeapTupleIsValid(tuple))
457 return InvalidOid;
459 SysCache[cacheId]->cc_tupdesc,
460 &isNull));
461 Assert(!isNull); /* columns used as oids should never be NULL */
462 ReleaseSysCache(tuple);
463 return result;
464}
#define Assert(condition)
Definition c.h:943
uint32 result
#define HeapTupleIsValid(tuple)
Definition htup.h:78
static Datum heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
static Oid DatumGetObjectId(Datum X)
Definition postgres.h:242
#define InvalidOid
unsigned int Oid
void ReleaseSysCache(HeapTuple tuple)
Definition syscache.c:265
HeapTuple SearchSysCache(SysCacheIdentifier cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
Definition syscache.c:209

References Assert, DatumGetObjectId(), fb(), heap_getattr(), HeapTupleIsValid, InvalidOid, ReleaseSysCache(), result, SearchSysCache(), and SysCache.

◆ InitCatalogCache()

void InitCatalogCache ( void  )
extern

Definition at line 111 of file syscache.c.

112{
113 SysCacheIdentifier cacheId;
114
116
118
119 for (cacheId = 0; cacheId < SysCacheSize; cacheId++)
120 {
121 /*
122 * Assert that every enumeration value defined in syscache.h has been
123 * populated in the cacheinfo array.
124 */
125 Assert(OidIsValid(cacheinfo[cacheId].reloid));
126 Assert(OidIsValid(cacheinfo[cacheId].indoid));
127 /* .nbuckets and .key[] are checked by InitCatCache() */
128
129 SysCache[cacheId] = InitCatCache(cacheId,
130 cacheinfo[cacheId].reloid,
131 cacheinfo[cacheId].indoid,
132 cacheinfo[cacheId].nkeys,
133 cacheinfo[cacheId].key,
134 cacheinfo[cacheId].nbuckets);
135 if (!SysCache[cacheId])
136 elog(ERROR, "could not initialize cache %u (%d)",
137 cacheinfo[cacheId].reloid, cacheId);
138 /* Accumulate data for OID lists, too */
140 cacheinfo[cacheId].reloid;
142 cacheinfo[cacheId].reloid;
144 cacheinfo[cacheId].indoid;
145 /* see comments for RelationInvalidatesSnapshotsOnly */
147 }
148
151
152 /* Sort and de-dup OID arrays, so we can use binary search. */
154 sizeof(Oid), oid_compare);
158
160 sizeof(Oid), oid_compare);
163 sizeof(Oid), oid_compare);
164
165 CacheInitialized = true;
166}
#define lengthof(array)
Definition c.h:873
#define OidIsValid(objectId)
Definition c.h:858
CatCache * InitCatCache(int id, Oid reloid, Oid indexoid, int nkeys, const int *key, int nbuckets)
Definition catcache.c:885
#define qsort(a, b, c, d)
Definition port.h:495
static size_t qunique(void *array, size_t elements, size_t width, int(*compare)(const void *, const void *))
Definition qunique.h:21
static bool CacheInitialized
Definition syscache.c:89
static int oid_compare(const void *a, const void *b)
Definition syscache.c:788
static int SysCacheSupportingRelOidSize
Definition syscache.c:97
static Oid SysCacheRelationOid[SysCacheSize]
Definition syscache.c:92
static Oid SysCacheSupportingRelOid[SysCacheSize *2]
Definition syscache.c:96
static int SysCacheRelationOidSize
Definition syscache.c:93
bool RelationInvalidatesSnapshotsOnly(Oid relid)
Definition syscache.c:715

References Assert, CacheInitialized, elog, ERROR, fb(), InitCatCache(), lengthof, oid_compare(), OidIsValid, qsort, qunique(), RelationInvalidatesSnapshotsOnly(), SysCache, SysCacheRelationOid, SysCacheRelationOidSize, SysCacheSupportingRelOid, and SysCacheSupportingRelOidSize.

Referenced by InitPostgres().

◆ InitCatalogCachePhase2()

void InitCatalogCachePhase2 ( void  )
extern

Definition at line 181 of file syscache.c.

182{
183 SysCacheIdentifier cacheId;
184
186
187 for (cacheId = 0; cacheId < SysCacheSize; cacheId++)
188 InitCatCachePhase2(SysCache[cacheId], true);
189}
void InitCatCachePhase2(CatCache *cache, bool touch_index)
Definition catcache.c:1245

References Assert, CacheInitialized, fb(), InitCatCachePhase2(), and SysCache.

Referenced by RelationCacheInitializePhase3().

◆ RelationHasSysCache()

bool RelationHasSysCache ( Oid  relid)
extern

Definition at line 738 of file syscache.c.

739{
740 int low = 0,
741 high = SysCacheRelationOidSize - 1;
742
743 while (low <= high)
744 {
745 int middle = low + (high - low) / 2;
746
747 if (SysCacheRelationOid[middle] == relid)
748 return true;
749 if (SysCacheRelationOid[middle] < relid)
750 low = middle + 1;
751 else
752 high = middle - 1;
753 }
754
755 return false;
756}

References fb(), SysCacheRelationOid, and SysCacheRelationOidSize.

Referenced by GetNonHistoricCatalogSnapshot().

◆ RelationInvalidatesSnapshotsOnly()

bool RelationInvalidatesSnapshotsOnly ( Oid  relid)
extern

Definition at line 715 of file syscache.c.

716{
717 switch (relid)
718 {
720 case DependRelationId:
726 return true;
727 default:
728 break;
729 }
730
731 return false;
732}

References fb().

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

◆ RelationSupportsSysCache()

bool RelationSupportsSysCache ( Oid  relid)
extern

Definition at line 763 of file syscache.c.

764{
765 int low = 0,
767
768 while (low <= high)
769 {
770 int middle = low + (high - low) / 2;
771
772 if (SysCacheSupportingRelOid[middle] == relid)
773 return true;
774 if (SysCacheSupportingRelOid[middle] < relid)
775 low = middle + 1;
776 else
777 high = middle - 1;
778 }
779
780 return false;
781}

References fb(), SysCacheSupportingRelOid, and SysCacheSupportingRelOidSize.

Referenced by heap_update(), and RelationIdIsInInitFile().

◆ ReleaseSysCache()

void ReleaseSysCache ( HeapTuple  tuple)
extern

Definition at line 265 of file syscache.c.

266{
267 ReleaseCatCache(tuple);
268}
void ReleaseCatCache(HeapTuple tuple)
Definition catcache.c:1668

References ReleaseCatCache().

Referenced by aclitemout(), add_cast_to(), add_function_cost(), AddEnumLabel(), AddRoleMems(), agg_args_support_sendreceive(), AggregateCreate(), AlterDomainValidateConstraint(), AlterEnum(), AlterObjectRename_internal(), AlterOpFamily(), AlterPublicationOptions(), AlterPublicationSchemas(), AlterPublicationTables(), AlterRole(), AlterRoleSet(), AlterSchemaOwner(), AlterSchemaOwner_oid(), AlterStatistics(), AlterTSConfiguration(), AlterTSDictionary(), AlterType(), AlterTypeOwner(), AlterTypeOwner_oid(), AlterTypeRecurse(), amvalidate(), appendFunctionName(), appendOrderBySuffix(), assignOperTypes(), assignProcTypes(), ATAddForeignKeyConstraint(), ATDetachCheckNoForeignKeyRefs(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecAlterConstraint(), ATExecChangeOwner(), ATExecDropColumn(), ATExecSetExpression(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetStatistics(), ATPostAlterTypeCleanup(), ATPrepAlterColumnType(), AttachPartitionForeignKey(), attribute_is_analyzable(), attribute_statistics_update(), blvalidate(), brincostestimate(), brinvalidate(), btvalidate(), build_coercion_expression(), build_edge_vertex_link_quals(), cached_function_compile(), CacheInvalidateRelcacheByRelid(), call_pltcl_start_proc(), CallStmtResultDesc(), check_amop_signature(), check_amproc_signature(), check_and_fetch_column_list(), check_default_text_search_config(), check_element_properties(), check_enable_rls(), check_for_column_name_collision(), check_object_ownership(), check_role(), check_session_authorization(), CheckFunctionValidatorAccess(), CheckIndexCompatible(), CheckMyDatabase(), CloneFkReferenced(), CloneFkReferencing(), coerce_type(), CollationIsVisibleExt(), compatible_oper(), compatible_oper_opid(), compile_plperl_function(), compile_pltcl_function(), compute_return_type(), ComputeIndexAttrs(), ComputePartitionAttrs(), ConstraintSetParentConstraint(), ConstructTupleDescriptor(), ConversionIsVisibleExt(), convert_column_name(), create_pe_for_element(), create_pg_locale(), create_pg_locale_builtin(), create_pg_locale_icu(), create_pg_locale_libc(), CreateCast(), CreateFunction(), CreateProceduralLanguage(), CreateRole(), CreateSchemaCommand(), CreateStatistics(), CreateTransform(), database_is_invalid_oid(), DefineCollation(), DefineDomain(), DefineIndex(), DefineOpClass(), DefineTSConfiguration(), DefineType(), delete_pg_statistic(), delete_pg_statistic_ext_data(), DeleteRelationTuple(), DeleteSequenceTuple(), deparseOpExpr(), deparseScalarArrayOpExpr(), DetachPartitionFinalize(), do_autovacuum(), DropObjectById(), DropRole(), DropSubscription(), enum_cmp_internal(), enum_in(), enum_out(), enum_recv(), enum_send(), errdatatype(), eval_const_expressions_mutator(), examine_indexcol_variable(), examine_simple_variable(), examine_variable(), ExecGrant_Attribute(), ExecGrant_common(), ExecGrant_Parameter(), ExecGrant_Relation(), ExecHashBuildSkewHash(), ExecInitAgg(), ExecuteCallStmt(), ExecuteDoStmt(), expand_all_col_privileges(), expand_vacuum_rel(), extended_statistics_update(), fetch_agg_sort_op(), fetch_fp_info(), fillTypeDesc(), 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_extended(), format_operator_parts(), format_procedure_extended(), format_procedure_parts(), format_type_extended(), func_get_detail(), func_parallel(), func_strict(), func_volatile(), FuncNameAsType(), FunctionIsVisibleExt(), 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_am_name(), get_am_type_oid(), get_and_validate_seq_info(), get_array_type(), get_attavgwidth(), get_attgenerated(), get_attname(), get_attnotnull(), get_attnum(), get_attoptions(), 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_index(), get_constraint_name(), get_constraint_type(), get_database_name(), get_db_info(), get_default_acl_internal(), get_default_partition_oid(), get_edge_oid(), get_element_property_expr(), get_element_relid(), get_element_type(), get_extension_name(), get_extension_schema(), 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_index_isclustered(), get_index_isreplident(), get_index_isvalid(), get_language_name(), get_multirange_range(), 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_method(), get_opclass_name(), get_opclass_oid(), get_opclass_opfamily_and_input_type(), get_opcode(), get_opfamily_member(), get_opfamily_method(), get_opfamily_name(), get_opfamily_oid(), get_opfamily_proc(), get_opname(), get_oprjoin(), get_oprrest(), get_partition_bound_spec(), get_propgraph_label_name(), get_propgraph_property_name(), get_publication_name(), get_qual_for_range(), get_range_collation(), get_range_constructor2(), get_range_multirange(), get_range_subtype(), get_rel_name(), get_rel_namespace(), get_rel_persistence(), get_rel_relam(), get_rel_relispartition(), get_rel_relkind(), get_rel_tablespace(), get_rel_type_id(), get_relation_statistics(), get_relation_statistics_worker(), get_rewrite_oid(), get_ri_constraint_root(), get_role_password(), get_rolespec_name(), get_rte_attribute_is_dropped(), 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_typsubscript(), get_typtype(), get_vertex_oid(), getBaseTypeAndTypmod(), getExtensionType(), GetFdwRoutineByServerId(), GetForeignColumnOptions(), GetForeignDataWrapperExtended(), GetForeignServerExtended(), GetForeignServerIdByRelId(), GetForeignTable(), GetIndexAmRoutineByAmId(), getObjectDescription(), getObjectIdentityParts(), getOpFamilyDescription(), getOpFamilyIdentity(), getProcedureTypeDescription(), GetPublication(), getPublicationSchemaInfo(), getRelationDescription(), getRelationIdentity(), getRelationTypeDescription(), GetSubscription(), GetSubscriptionRelState(), GetSysCacheOid(), getTypeBinaryInputInfo(), getTypeBinaryOutputInfo(), getTypeInputInfo(), getTypeOutputInfo(), GetUserMapping(), GetUserNameFromId(), ginvalidate(), gistvalidate(), has_bypassrls_privilege(), has_createrole_privilege(), has_rolreplication(), has_subclass(), hash_ok_operator(), hashvalidate(), have_createdb_privilege(), heap_drop_with_catalog(), inclusion_get_strategy_procinfo(), index_check_primary_key(), index_create(), index_create_copy(), index_drop(), index_get_partition(), indexam_property(), IndexGetRelation(), IndexSupportsBackwardScan(), init_database_collation(), initialize_peragg(), InitializeSessionUserId(), inline_function_in_from(), insert_property_record(), InsertRule(), internal_get_result_type(), interpret_function_parameter_list(), is_publishable_table(), IsBinaryCoercibleWithCast(), IsIndexUsableForFindingDeletedTuple(), load_domaintype_info(), load_rangetype_info(), logicalrep_write_tuple(), logicalrep_write_typ(), lookup_collation(), lookup_ts_config_cache(), lookup_ts_dictionary_cache(), lookup_ts_parser_cache(), lookup_type_cache(), LookupTypeNameOid(), make_callstmt_target(), make_inh_translation_list(), make_new_heap(), make_op(), make_propgraphdef_elements(), make_scalar_array_op(), map_sql_table_to_xmlschema(), map_sql_type_to_xml_name(), minmax_get_strategy_procinfo(), minmax_multi_get_strategy_procinfo(), nextval_internal(), object_aclmask_ext(), object_ownercheck(), op_hashjoinable(), op_input_types(), op_mergejoinable(), OpclassIsVisibleExt(), OperatorGet(), OperatorIsVisibleExt(), OpernameGetOprid(), OpfamilyIsVisibleExt(), ParseFuncOrColumn(), parseTypeString(), pg_attribute_aclcheck_all_ext(), pg_attribute_aclmask_ext(), pg_basetype(), pg_class_aclmask_ext(), pg_collation_actual_version(), pg_database_collation_actual_version(), pg_get_constraintdef_worker(), pg_get_database_ddl_internal(), pg_get_function_arg_default(), pg_get_function_arguments(), pg_get_function_identity_arguments(), pg_get_function_result(), pg_get_function_sqlbody(), pg_get_functiondef(), pg_get_indexdef_worker(), pg_get_partkeydef_worker(), pg_get_propgraphdef(), pg_get_role_ddl_internal(), pg_get_statisticsobj_worker(), pg_get_statisticsobjdef_expressions(), pg_get_tablespace_ddl_internal(), pg_get_userbyid(), pg_namespace_aclmask_ext(), pg_nextoid(), pg_parameter_acl_aclmask(), pg_parameter_aclmask(), pg_relation_filenode(), pg_relation_filepath(), pg_relation_is_publishable(), pg_sequence_parameters(), pg_type_aclmask_ext(), pgoutput_row_filter_init(), plperl_validator(), plpgsql_build_datatype(), plpgsql_compile_callback(), plpgsql_parse_cwordtype(), plpgsql_validator(), plpython3_validator(), plsample_func_handler(), plsample_trigger_handler(), PLy_procedure_create(), PLy_procedure_get(), postgres_fdw_get_connections_internal(), prepare_column_cache(), preprocess_aggref(), preprocessNamespacePath(), print_function_arguments(), ProcedureCreate(), pub_rf_contains_invalid_column(), RangeVarCallbackForAlterRelation(), RangeVarCallbackForAttachIndex(), RangeVarCallbackForDropRelation(), RangeVarCallbackForPolicy(), RangeVarCallbackForRenameAttribute(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RangeVarCallbackForStats(), RangeVarCallbackForTruncate(), RangeVarCallbackOwnsRelation(), recordExtObjInitPriv(), refresh_by_match_merge(), regclassout(), regcollationout(), regconfigout(), regdictionaryout(), regoperout(), regprocout(), regtypeout(), relation_statistics_update(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationBuildPublicationDesc(), RelationCacheInitializePhase3(), RelationClearMissing(), relationHasPrimaryKey(), RelationInitIndexAccessInfo(), RelationInitTableAccessMethod(), RelationIsVisibleExt(), RelationReloadIndexInfo(), RemoveConstraintById(), removeExtObjInitPriv(), RemoveFunctionById(), RemoveOperatorById(), RemovePartitionKeyByRelId(), RemovePublicationById(), RemovePublicationRelById(), RemovePublicationSchemaById(), RemoveRoleFromInitPriv(), RemoveRoleFromObjectPolicy(), RemoveStatisticsById(), RemoveStatisticsDataById(), RemoveTSConfigurationById(), RemoveTypeById(), rename_constraint_internal(), RenameConstraint(), RenameRole(), replace_property_refs_mutator(), replorigin_by_name(), replorigin_by_oid(), replorigin_drop_by_name(), ResetSequence(), ResolveOpClass(), ri_GenerateQualCollation(), ri_LoadConstraintInfo(), roles_is_member_of(), SearchSysCacheAttName(), SearchSysCacheAttNum(), SearchSysCacheCopy(), SearchSysCacheCopyAttName(), SearchSysCacheCopyAttNum(), SearchSysCacheExists(), SearchSysCacheExistsAttName(), SearchSysCacheLocked1(), SearchSysCacheLockedCopy1(), sepgsql_proc_setattr(), sepgsql_relation_setattr(), sequence_options(), SetAttrMissing(), SetDefaultACL(), SetSequence(), simplify_function(), spgvalidate(), SPI_gettype(), statatt_get_type(), statext_dependencies_load(), statext_expressions_load(), statext_mcv_load(), statext_ndistinct_load(), StatisticsGetRelation(), StatisticsObjIsVisibleExt(), StoreAttrMissingVal(), superuser_arg(), transformCallStmt(), transformColumnDefinition(), transformColumnNameList(), transformColumnType(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformGraphTablePropertyRef(), transformOfType(), triggered_change_notification(), tryAttachPartitionForeignKey(), TryReuseForeignKey(), TSConfigIsVisibleExt(), TSDictionaryIsVisibleExt(), TSParserIsVisibleExt(), TSTemplateIsVisibleExt(), TupleDescInitEntry(), typeidTypeRelid(), typeIsOfTypedTable(), TypeIsVisibleExt(), typenameTypeId(), typenameTypeIdAndMod(), typeOrDomainTypeRelid(), update_attstats(), upsert_pg_statistic_ext_data(), validatePartitionedIndex(), and verify_dictoptions().

◆ SearchSysCache()

HeapTuple SearchSysCache ( SysCacheIdentifier  cacheId,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)
extern

Definition at line 209 of file syscache.c.

214{
215 Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]);
216
217 return SearchCatCache(SysCache[cacheId], key1, key2, key3, key4);
218}
HeapTuple SearchCatCache(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4)
Definition catcache.c:1361

References Assert, fb(), SearchCatCache(), and SysCache.

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

◆ SearchSysCache1()

HeapTuple SearchSysCache1 ( SysCacheIdentifier  cacheId,
Datum  key1 
)
extern

Definition at line 221 of file syscache.c.

223{
224 Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]);
225 Assert(SysCache[cacheId]->cc_nkeys == 1);
226
227 return SearchCatCache1(SysCache[cacheId], key1);
228}
HeapTuple SearchCatCache1(CatCache *cache, Datum v1)
Definition catcache.c:1378

References Assert, fb(), SearchCatCache1(), and SysCache.

Referenced by aclitemout(), add_cast_to(), add_function_cost(), AddRoleMems(), agg_args_support_sendreceive(), AggregateCreate(), AlterDomainValidateConstraint(), AlterEnum(), AlterObjectRename_internal(), AlterOpFamily(), AlterSchemaOwner(), AlterSchemaOwner_oid(), AlterStatistics(), AlterTSDictionary(), AlterTypeOwner_oid(), AlterTypeRecurse(), amvalidate(), appendFunctionName(), appendOrderBySuffix(), assignOperTypes(), assignProcTypes(), ATAddForeignKeyConstraint(), ATDetachCheckNoForeignKeyRefs(), ATExecAlterColumnGenericOptions(), ATExecAlterConstraint(), ATExecChangeOwner(), ATExecSetRelOptions(), ATPostAlterTypeCleanup(), AttachPartitionForeignKey(), blvalidate(), brinvalidate(), btvalidate(), build_coercion_expression(), build_edge_vertex_link_quals(), cached_function_compile(), CacheInvalidateRelcacheByRelid(), call_pltcl_start_proc(), CallStmtResultDesc(), check_amop_signature(), check_amproc_signature(), check_default_text_search_config(), check_element_properties(), check_enable_rls(), check_object_ownership(), check_role(), check_session_authorization(), CheckFunctionValidatorAccess(), CheckIndexCompatible(), CheckMyDatabase(), CloneFkReferenced(), CloneFkReferencing(), CollationIsVisibleExt(), compile_plperl_function(), compile_pltcl_function(), ConstraintSetParentConstraint(), ConstructTupleDescriptor(), ConversionIsVisibleExt(), create_pe_for_element(), create_pg_locale(), create_pg_locale_builtin(), create_pg_locale_icu(), create_pg_locale_libc(), CreateCast(), CreateEventTrigger(), CreateFunction(), CreateProceduralLanguage(), CreateSchemaCommand(), CreateTransform(), database_is_invalid_oid(), DefineCollation(), DefineIndex(), DefineOpClass(), DefineTSConfiguration(), DeleteRelationTuple(), DeleteSequenceTuple(), deparseOpExpr(), deparseScalarArrayOpExpr(), DetachPartitionFinalize(), do_autovacuum(), DropObjectById(), DropRole(), enum_cmp_internal(), enum_out(), enum_send(), errdatatype(), eval_const_expressions_mutator(), ExecGrant_Parameter(), ExecInitAgg(), ExecuteCallStmt(), ExecuteDoStmt(), expand_vacuum_rel(), fetch_agg_sort_op(), fetch_fp_info(), fillTypeDesc(), 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_extended(), format_operator_parts(), format_procedure_extended(), format_procedure_parts(), format_type_extended(), func_get_detail(), func_parallel(), func_strict(), func_volatile(), FunctionIsVisibleExt(), 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_am_name(), get_am_type_oid(), get_and_validate_seq_info(), get_array_type(), get_attstatsslot(), get_base_element_type(), get_collation(), get_collation_isdeterministic(), get_collation_name(), get_commutator(), get_constraint_index(), get_constraint_name(), get_constraint_type(), get_database_name(), get_db_info(), get_default_partition_oid(), get_element_relid(), get_element_type(), get_extension_name(), get_extension_schema(), 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_index_isclustered(), get_index_isreplident(), get_index_isvalid(), get_language_name(), get_multirange_range(), 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_method(), get_opclass_name(), get_opclass_opfamily_and_input_type(), get_opcode(), get_opfamily_method(), get_opfamily_name(), get_opname(), get_oprjoin(), get_oprrest(), get_partition_bound_spec(), get_propgraph_label_name(), get_propgraph_property_name(), get_publication_name(), get_qual_for_range(), get_range_collation(), get_range_constructor2(), get_range_multirange(), get_range_subtype(), get_rel_name(), get_rel_namespace(), get_rel_persistence(), get_rel_relam(), get_rel_relispartition(), get_rel_relkind(), get_rel_tablespace(), get_rel_type_id(), get_relation_statistics(), get_ri_constraint_root(), 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_typsubscript(), get_typtype(), getBaseTypeAndTypmod(), getExtensionType(), GetFdwRoutineByServerId(), GetForeignDataWrapperExtended(), GetForeignServerExtended(), GetForeignServerIdByRelId(), GetForeignTable(), GetIndexAmRoutineByAmId(), getObjectDescription(), getObjectIdentityParts(), getOpFamilyDescription(), getOpFamilyIdentity(), getProcedureTypeDescription(), GetPublication(), getPublicationSchemaInfo(), getRelationDescription(), getRelationIdentity(), getRelationTypeDescription(), GetSubscription(), GetTSConfigTuple(), getTypeBinaryInputInfo(), getTypeBinaryOutputInfo(), getTypeInputInfo(), getTypeOutputInfo(), GetUserNameFromId(), ginvalidate(), gistvalidate(), has_bypassrls_privilege(), has_createrole_privilege(), has_rolreplication(), has_subclass(), hash_ok_operator(), hashvalidate(), have_createdb_privilege(), heap_drop_with_catalog(), index_create(), index_create_copy(), index_drop(), index_get_partition(), indexam_property(), IndexGetRelation(), IndexSupportsBackwardScan(), init_database_collation(), initialize_peragg(), InitializeSessionUserId(), inline_function_in_from(), insert_property_record(), internal_get_result_type(), is_publishable_table(), IsIndexUsableForFindingDeletedTuple(), left_oper(), load_domaintype_info(), load_rangetype_info(), logicalrep_write_tuple(), logicalrep_write_typ(), lookup_ts_config_cache(), lookup_ts_dictionary_cache(), lookup_ts_parser_cache(), lookup_type_cache(), LookupTypeNameExtended(), make_callstmt_target(), make_new_heap(), make_propgraphdef_elements(), map_sql_table_to_xmlschema(), map_sql_type_to_xml_name(), nextval_internal(), object_aclmask_ext(), object_ownercheck(), op_hashjoinable(), op_input_types(), op_mergejoinable(), OpClassCacheLookup(), OpclassIsVisibleExt(), oper(), OperatorIsVisibleExt(), OpFamilyCacheLookup(), OpfamilyIsVisibleExt(), ParseFuncOrColumn(), pg_attribute_aclcheck_all_ext(), pg_attribute_aclmask_ext(), pg_basetype(), pg_class_aclmask_ext(), pg_collation_actual_version(), pg_database_collation_actual_version(), pg_get_constraintdef_worker(), pg_get_database_ddl_internal(), pg_get_function_arg_default(), pg_get_function_arguments(), pg_get_function_identity_arguments(), pg_get_function_result(), pg_get_function_sqlbody(), pg_get_functiondef(), pg_get_indexdef_worker(), pg_get_partkeydef_worker(), pg_get_propgraphdef(), pg_get_role_ddl_internal(), pg_get_statisticsobj_worker(), pg_get_statisticsobjdef_expressions(), pg_get_tablespace_ddl_internal(), pg_get_userbyid(), pg_namespace_aclmask_ext(), pg_parameter_acl_aclmask(), pg_parameter_aclmask(), pg_relation_filenode(), pg_relation_filepath(), pg_relation_is_publishable(), pg_sequence_parameters(), pg_type_aclmask_ext(), plperl_validator(), plpgsql_build_datatype(), plpgsql_compile_callback(), plpgsql_parse_cwordtype(), plpgsql_validator(), plpython3_validator(), plsample_func_handler(), plsample_trigger_handler(), PLy_procedure_create(), PLy_procedure_get(), postgres_fdw_get_connections_internal(), prepare_column_cache(), preprocess_aggref(), preprocessNamespacePath(), print_function_arguments(), RangeVarCallbackForAlterRelation(), RangeVarCallbackForAttachIndex(), RangeVarCallbackForDropRelation(), RangeVarCallbackForPolicy(), RangeVarCallbackForRenameAttribute(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RangeVarCallbackForStats(), RangeVarCallbackForTruncate(), RangeVarCallbackOwnsRelation(), recordExtObjInitPriv(), refresh_by_match_merge(), regclassout(), regcollationout(), regconfigout(), regdictionaryout(), regoperout(), regprocout(), regtypeout(), relation_statistics_update(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationBuildPublicationDesc(), RelationCacheInitializePhase3(), relationHasPrimaryKey(), RelationInitIndexAccessInfo(), RelationInitTableAccessMethod(), RelationIsVisibleExt(), RelationReloadIndexInfo(), RemoveConstraintById(), removeExtObjInitPriv(), RemoveFunctionById(), RemoveOperatorById(), RemovePartitionKeyByRelId(), RemovePublicationById(), RemovePublicationRelById(), RemovePublicationSchemaById(), RemoveRoleFromInitPriv(), RemoveRoleFromObjectPolicy(), RemoveStatisticsById(), RemoveTSConfigurationById(), RemoveTypeById(), rename_constraint_internal(), RenameConstraint(), RenameRole(), replorigin_by_name(), replorigin_by_oid(), replorigin_drop_by_name(), ResetSequence(), ResolveOpClass(), ri_GenerateQualCollation(), ri_LoadConstraintInfo(), roles_is_member_of(), SearchSysCacheLocked1(), sepgsql_proc_setattr(), sepgsql_relation_setattr(), sequence_options(), SetSequence(), simplify_function(), spgvalidate(), SPI_gettype(), StatisticsGetRelation(), StatisticsObjIsVisibleExt(), superuser_arg(), transformCallStmt(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), triggered_change_notification(), tryAttachPartitionForeignKey(), TryReuseForeignKey(), TSConfigIsVisibleExt(), TSDictionaryIsVisibleExt(), TSParserIsVisibleExt(), TSTemplateIsVisibleExt(), TupleDescInitEntry(), typeidType(), typeidTypeRelid(), typeIsOfTypedTable(), TypeIsVisibleExt(), typeOrDomainTypeRelid(), validatePartitionedIndex(), and verify_dictoptions().

◆ SearchSysCache2()

HeapTuple SearchSysCache2 ( SysCacheIdentifier  cacheId,
Datum  key1,
Datum  key2 
)
extern

Definition at line 231 of file syscache.c.

233{
234 Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]);
235 Assert(SysCache[cacheId]->cc_nkeys == 2);
236
237 return SearchCatCache2(SysCache[cacheId], key1, key2);
238}
HeapTuple SearchCatCache2(CatCache *cache, Datum v1, Datum v2)
Definition catcache.c:1386

References Assert, fb(), SearchCatCache2(), and SysCache.

Referenced by AddEnumLabel(), AlterPublicationOptions(), AlterPublicationSchemas(), AlterPublicationTables(), attribute_is_analyzable(), CastCreate(), check_and_fetch_column_list(), check_for_column_name_collision(), convert_column_name(), CreateTransform(), delete_pg_statistic_ext_data(), DropSubscription(), enum_in(), enum_recv(), ExecGrant_Attribute(), expand_all_col_privileges(), extended_statistics_update(), find_coercion_pathway(), find_typmod_coercion_function(), fixup_whole_row_references(), get_attgenerated(), get_attname(), get_attnotnull(), get_attoptions(), get_attribute_options(), get_atttype(), get_atttypetypmodcoll(), get_edge_oid(), get_element_property_expr(), get_object_address_usermapping(), get_relation_statistics_worker(), get_rewrite_oid(), get_rte_attribute_is_dropped(), get_transform_fromsql(), get_transform_tosql(), get_vertex_oid(), GetForeignColumnOptions(), GetSubscriptionRelState(), GetUserMapping(), index_check_primary_key(), index_create_copy(), InsertRule(), IsBinaryCoercibleWithCast(), pg_attribute_aclcheck_all_ext(), pg_attribute_aclmask_ext(), pgoutput_row_filter_init(), pub_rf_contains_invalid_column(), recordExtObjInitPriv(), RelationClearMissing(), removeExtObjInitPriv(), RemoveStatisticsDataById(), replace_property_refs_mutator(), SearchSysCacheAttName(), SearchSysCacheAttNum(), statatt_get_type(), statext_dependencies_load(), statext_expressions_load(), statext_mcv_load(), statext_ndistinct_load(), StoreAttrMissingVal(), transformGraphTablePropertyRef(), and upsert_pg_statistic_ext_data().

◆ SearchSysCache3()

◆ SearchSysCache4()

HeapTuple SearchSysCache4 ( SysCacheIdentifier  cacheId,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)
extern

Definition at line 251 of file syscache.c.

253{
254 Assert(cacheId >= 0 && cacheId < SysCacheSize && SysCache[cacheId]);
255 Assert(SysCache[cacheId]->cc_nkeys == 4);
256
257 return SearchCatCache4(SysCache[cacheId], key1, key2, key3, key4);
258}
HeapTuple SearchCatCache4(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4)
Definition catcache.c:1402

References Assert, fb(), SearchCatCache4(), and SysCache.

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

◆ SearchSysCacheAttName()

HeapTuple SearchSysCacheAttName ( Oid  relid,
const char attname 
)
extern

Definition at line 476 of file syscache.c.

477{
478 HeapTuple tuple;
479
480 tuple = SearchSysCache2(ATTNAME,
481 ObjectIdGetDatum(relid),
483 if (!HeapTupleIsValid(tuple))
484 return NULL;
485 if (((Form_pg_attribute) GETSTRUCT(tuple))->attisdropped)
486 {
487 ReleaseSysCache(tuple);
488 return NULL;
489 }
490 return tuple;
491}
static void * GETSTRUCT(const HeapTupleData *tuple)
NameData attname
FormData_pg_attribute * Form_pg_attribute
static Datum ObjectIdGetDatum(Oid X)
Definition postgres.h:252
static Datum CStringGetDatum(const char *X)
Definition postgres.h:370
HeapTuple SearchSysCache2(SysCacheIdentifier cacheId, Datum key1, Datum key2)
Definition syscache.c:231

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

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

◆ SearchSysCacheAttNum()

HeapTuple SearchSysCacheAttNum ( Oid  relid,
int16  attnum 
)
extern

Definition at line 539 of file syscache.c.

540{
541 HeapTuple tuple;
542
543 tuple = SearchSysCache2(ATTNUM,
544 ObjectIdGetDatum(relid),
546 if (!HeapTupleIsValid(tuple))
547 return NULL;
548 if (((Form_pg_attribute) GETSTRUCT(tuple))->attisdropped)
549 {
550 ReleaseSysCache(tuple);
551 return NULL;
552 }
553 return tuple;
554}
int16 attnum
static Datum Int16GetDatum(int16 X)
Definition postgres.h:172

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

Referenced by ATExecSetStatistics(), and SearchSysCacheCopyAttNum().

◆ SearchSysCacheCopy()

HeapTuple SearchSysCacheCopy ( SysCacheIdentifier  cacheId,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)
extern

Definition at line 375 of file syscache.c.

380{
381 HeapTuple tuple,
382 newtuple;
383
384 tuple = SearchSysCache(cacheId, key1, key2, key3, key4);
385 if (!HeapTupleIsValid(tuple))
386 return tuple;
387 newtuple = heap_copytuple(tuple);
388 ReleaseSysCache(tuple);
389 return newtuple;
390}
HeapTuple heap_copytuple(HeapTuple tuple)
Definition heaptuple.c:686

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

◆ SearchSysCacheCopyAttName()

HeapTuple SearchSysCacheCopyAttName ( Oid  relid,
const char attname 
)
extern

Definition at line 499 of file syscache.c.

500{
501 HeapTuple tuple,
502 newtuple;
503
504 tuple = SearchSysCacheAttName(relid, attname);
505 if (!HeapTupleIsValid(tuple))
506 return tuple;
507 newtuple = heap_copytuple(tuple);
508 ReleaseSysCache(tuple);
509 return newtuple;
510}
HeapTuple SearchSysCacheAttName(Oid relid, const char *attname)
Definition syscache.c:476

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

Referenced by ATExecAddColumn(), ATExecAddIdentity(), ATExecAlterColumnType(), ATExecDropColumn(), ATExecDropExpression(), ATExecDropIdentity(), ATExecDropNotNull(), ATExecSetCompression(), ATExecSetIdentity(), ATExecSetStorage(), ATPrepDropExpression(), MergeAttributesIntoExisting(), and renameatt_internal().

◆ SearchSysCacheCopyAttNum()

HeapTuple SearchSysCacheCopyAttNum ( Oid  relid,
int16  attnum 
)
extern

Definition at line 562 of file syscache.c.

563{
564 HeapTuple tuple,
565 newtuple;
566
567 tuple = SearchSysCacheAttNum(relid, attnum);
568 if (!HeapTupleIsValid(tuple))
569 return NULL;
570 newtuple = heap_copytuple(tuple);
571 ReleaseSysCache(tuple);
572 return newtuple;
573}
HeapTuple SearchSysCacheAttNum(Oid relid, int16 attnum)
Definition syscache.c:539

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

Referenced by dropconstraint_internal(), pg_get_acl(), set_attnotnull(), and SetIndexStorageProperties().

◆ SearchSysCacheExists()

bool SearchSysCacheExists ( SysCacheIdentifier  cacheId,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)
extern

Definition at line 421 of file syscache.c.

426{
427 HeapTuple tuple;
428
429 tuple = SearchSysCache(cacheId, key1, key2, key3, key4);
430 if (!HeapTupleIsValid(tuple))
431 return false;
432 ReleaseSysCache(tuple);
433 return true;
434}

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

◆ SearchSysCacheExistsAttName()

bool SearchSysCacheExistsAttName ( Oid  relid,
const char attname 
)
extern

Definition at line 518 of file syscache.c.

519{
520 HeapTuple tuple;
521
522 tuple = SearchSysCacheAttName(relid, attname);
523 if (!HeapTupleIsValid(tuple))
524 return false;
525 ReleaseSysCache(tuple);
526 return true;
527}

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

Referenced by attribute_statistics_update(), and RemoveInheritance().

◆ SearchSysCacheList()

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

Definition at line 672 of file syscache.c.

674{
676 elog(ERROR, "invalid cache ID: %d", cacheId);
677
678 return SearchCatCacheList(SysCache[cacheId], nkeys,
679 key1, key2, key3);
680}
CatCList * SearchCatCacheList(CatCache *cache, int nkeys, Datum v1, Datum v2, Datum v3)
Definition catcache.c:1740

References elog, ERROR, fb(), catclist::nkeys, SearchCatCacheList(), and SysCache.

◆ SearchSysCacheLocked1()

HeapTuple SearchSysCacheLocked1 ( SysCacheIdentifier  cacheId,
Datum  key1 
)
extern

Definition at line 283 of file syscache.c.

285{
286 CatCache *cache = SysCache[cacheId];
287 ItemPointerData tid;
288 LOCKTAG tag;
289
290 /*----------
291 * Since inplace updates may happen just before our LockTuple(), we must
292 * return content acquired after LockTuple() of the TID we return. If we
293 * just fetched twice instead of looping, the following sequence would
294 * defeat our locking:
295 *
296 * GRANT: SearchSysCache1() = TID (1,5)
297 * GRANT: LockTuple(pg_class, (1,5))
298 * [no more inplace update of (1,5) until we release the lock]
299 * CLUSTER: SearchSysCache1() = TID (1,5)
300 * CLUSTER: heap_update() = TID (1,8)
301 * CLUSTER: COMMIT
302 * GRANT: SearchSysCache1() = TID (1,8)
303 * GRANT: return (1,8) from SearchSysCacheLocked1()
304 * VACUUM: SearchSysCache1() = TID (1,8)
305 * VACUUM: LockTuple(pg_class, (1,8)) # two TIDs now locked for one rel
306 * VACUUM: inplace update
307 * GRANT: heap_update() = (1,9) # lose inplace update
308 *
309 * In the happy case, this takes two fetches, one to determine the TID to
310 * lock and another to get the content and confirm the TID didn't change.
311 *
312 * This is valid even if the row gets updated to a new TID, the old TID
313 * becomes LP_UNUSED, and the row gets updated back to its old TID. We'd
314 * still hold the right LOCKTAG_TUPLE and a copy of the row captured after
315 * the LOCKTAG_TUPLE.
316 */
318 for (;;)
319 {
320 HeapTuple tuple;
322
323 tuple = SearchSysCache1(cacheId, key1);
324 if (ItemPointerIsValid(&tid))
325 {
326 if (!HeapTupleIsValid(tuple))
327 {
328 LockRelease(&tag, lockmode, false);
329 return tuple;
330 }
331 if (ItemPointerEquals(&tid, &tuple->t_self))
332 return tuple;
333 LockRelease(&tag, lockmode, false);
334 }
335 else if (!HeapTupleIsValid(tuple))
336 return tuple;
337
338 tid = tuple->t_self;
339 ReleaseSysCache(tuple);
340
341 /*
342 * Do like LockTuple(rel, &tid, lockmode). While cc_relisshared won't
343 * change from one iteration to another, it may have been a temporary
344 * "false" until our first SearchSysCache1().
345 */
348 cache->cc_reloid,
351 (void) LockAcquire(&tag, lockmode, false, false);
352
353 /*
354 * If an inplace update just finished, ensure we process the syscache
355 * inval.
356 *
357 * If a heap_update() call just released its LOCKTAG_TUPLE, we'll
358 * probably find the old tuple and reach "tuple concurrently updated".
359 * If that heap_update() aborts, our LOCKTAG_TUPLE blocks inplace
360 * updates while our caller works.
361 */
363 }
364}
Oid MyDatabaseId
Definition globals.c:96
void AcceptInvalidationMessages(void)
Definition inval.c:930
bool ItemPointerEquals(const ItemPointerData *pointer1, const ItemPointerData *pointer2)
Definition itemptr.c:35
static void ItemPointerSetInvalid(ItemPointerData *pointer)
Definition itemptr.h:184
static OffsetNumber ItemPointerGetOffsetNumber(const ItemPointerData *pointer)
Definition itemptr.h:124
static BlockNumber ItemPointerGetBlockNumber(const ItemPointerData *pointer)
Definition itemptr.h:103
static bool ItemPointerIsValid(const ItemPointerData *pointer)
Definition itemptr.h:83
LockAcquireResult LockAcquire(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock, bool dontWait)
Definition lock.c:807
bool LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock)
Definition lock.c:2111
int LOCKMODE
Definition lockdefs.h:26
#define InplaceUpdateTupleLock
Definition lockdefs.h:48
#define SET_LOCKTAG_TUPLE(locktag, dboid, reloid, blocknum, offnum)
Definition locktag.h:117
ItemPointerData t_self
Definition htup.h:65
bool cc_relisshared
Definition catcache.h:62
HeapTuple SearchSysCache1(SysCacheIdentifier cacheId, Datum key1)
Definition syscache.c:221

References AcceptInvalidationMessages(), catcache::cc_relisshared, catcache::cc_reloid, fb(), HeapTupleIsValid, InplaceUpdateTupleLock, InvalidOid, ItemPointerEquals(), ItemPointerGetBlockNumber(), ItemPointerGetOffsetNumber(), ItemPointerIsValid(), ItemPointerSetInvalid(), LockAcquire(), LockRelease(), MyDatabaseId, ReleaseSysCache(), SearchSysCache1(), SET_LOCKTAG_TUPLE, SysCache, and HeapTupleData::t_self.

Referenced by ATExecSetRelOptions(), ExecGrant_common(), ExecGrant_Relation(), and SearchSysCacheLockedCopy1().

◆ SearchSysCacheLockedCopy1()

HeapTuple SearchSysCacheLockedCopy1 ( SysCacheIdentifier  cacheId,
Datum  key1 
)
extern

Definition at line 400 of file syscache.c.

402{
403 HeapTuple tuple,
404 newtuple;
405
406 tuple = SearchSysCacheLocked1(cacheId, key1);
407 if (!HeapTupleIsValid(tuple))
408 return tuple;
409 newtuple = heap_copytuple(tuple);
410 ReleaseSysCache(tuple);
411 return newtuple;
412}
HeapTuple SearchSysCacheLocked1(SysCacheIdentifier cacheId, Datum key1)
Definition syscache.c:283

References fb(), heap_copytuple(), HeapTupleIsValid, ReleaseSysCache(), and SearchSysCacheLocked1().

Referenced by AlterRelationNamespaceInternal(), get_catalog_object_by_oid_extended(), RelationSetNewRelfilenumber(), RenameDatabase(), RenameRelationInternal(), SetDatabaseHasLoginEventTriggers(), SetRelationTableSpace(), and update_relispartition().

◆ SysCacheGetAttr()

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

Definition at line 596 of file syscache.c.

599{
600 /*
601 * We just need to get the TupleDesc out of the cache entry, and then we
602 * can apply heap_getattr(). Normally the cache control data is already
603 * valid (because the caller recently fetched the tuple via this same
604 * cache), but there are cases where we have to initialize the cache here.
605 */
607 elog(ERROR, "invalid cache ID: %d", cacheId);
608 if (!SysCache[cacheId]->cc_tupdesc)
609 {
610 InitCatCachePhase2(SysCache[cacheId], false);
611 Assert(SysCache[cacheId]->cc_tupdesc);
612 }
613
615 SysCache[cacheId]->cc_tupdesc,
616 isNull);
617}

References Assert, elog, ERROR, fb(), heap_getattr(), InitCatCachePhase2(), and SysCache.

Referenced by AlterCollation(), AlterForeignDataWrapper(), AlterForeignServer(), AlterFunction(), AlterPublicationTables(), AlterRole(), AlterSchemaOwner_internal(), AlterTSDictionary(), AlterUserMapping(), ATExecAlterColumnGenericOptions(), ATExecChangeOwner(), ATExecGenericOptions(), ATExecSetOptions(), ATExecSetRelOptions(), attribute_is_analyzable(), build_function_result_tupdesc_t(), check_and_fetch_column_list(), CheckMyDatabase(), compile_plperl_function(), create_pg_locale(), create_pg_locale_icu(), DeconstructFkConstraintRow(), DefineCollation(), DefineDomain(), DropSubscription(), ExecGrant_Attribute(), ExecGrant_common(), ExecGrant_Parameter(), ExecGrant_Relation(), ExecInitAgg(), expand_function_arguments(), extended_statistics_update(), fetch_statentries_for_relation(), flatten_reloptions(), fmgr_security_definer(), fmgr_sql_validator(), FuncnameGetCandidates(), generate_partition_qual(), generateClonedExtStatsStmt(), generateClonedIndexStmt(), get_attoptions(), get_attribute_options(), get_db_info(), get_default_acl_internal(), get_func_arg_info(), get_func_trftypes(), get_partition_bound_spec(), get_relation_statistics(), get_role_password(), get_tablespace(), get_typdefault(), GetForeignColumnOptions(), GetForeignDataWrapperExtended(), GetForeignServerExtended(), GetForeignTable(), GetSubscription(), GetSubscriptionRelations(), GetSubscriptionRelState(), GetUserMapping(), index_create_copy(), initialize_peragg(), inline_function(), inline_sql_function_in_from(), lookup_ts_dictionary_cache(), make_new_heap(), MatchNamedCall(), object_aclmask_ext(), pg_attribute_aclcheck_all_ext(), pg_attribute_aclmask_ext(), pg_class_aclmask_ext(), pg_get_acl(), pg_get_constraintdef_worker(), pg_get_database_ddl_internal(), pg_get_function_arg_default(), pg_get_function_sqlbody(), pg_get_functiondef(), pg_get_publication_tables(), pg_get_role_ddl_internal(), pg_get_tablespace_ddl_internal(), pg_namespace_aclmask_ext(), pg_parameter_acl_aclmask(), pg_parameter_aclmask(), pg_type_aclmask_ext(), pgoutput_row_filter_init(), plsample_func_handler(), plsample_trigger_handler(), PLy_procedure_create(), prepare_sql_fn_parse_info(), preprocess_aggref(), print_function_arguments(), ProcedureCreate(), pub_rf_contains_invalid_column(), recordExtObjInitPriv(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), SetDefaultACL(), sql_compile_callback(), statext_dependencies_load(), statext_expressions_load(), statext_mcv_load(), statext_ndistinct_load(), StorePartitionBound(), SysCacheGetAttrNotNull(), and transformCallStmt().

◆ SysCacheGetAttrNotNull()

Datum SysCacheGetAttrNotNull ( SysCacheIdentifier  cacheId,
HeapTuple  tup,
AttrNumber  attributeNumber 
)
extern

Definition at line 626 of file syscache.c.

628{
629 bool isnull;
630 Datum attr;
631
632 attr = SysCacheGetAttr(cacheId, tup, attributeNumber, &isnull);
633
634 if (isnull)
635 {
636 elog(ERROR,
637 "unexpected null value in cached tuple for catalog %s column %s",
638 get_rel_name(cacheinfo[cacheId].reloid),
639 NameStr(TupleDescAttr(SysCache[cacheId]->cc_tupdesc, attributeNumber - 1)->attname));
640 }
641
642 return attr;
643}
#define NameStr(name)
Definition c.h:835
char * get_rel_name(Oid relid)
Definition lsyscache.c:2148
uint64_t Datum
Definition postgres.h:70
Datum SysCacheGetAttr(SysCacheIdentifier cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
Definition syscache.c:596
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
Definition tupdesc.h:178

References attname, elog, ERROR, fb(), get_rel_name(), NameStr, SysCache, SysCacheGetAttr(), and TupleDescAttr().

Referenced by AlterCollation(), AlterDomainValidateConstraint(), ATExecAlterCheckConstrEnforceability(), build_edge_vertex_link_quals(), build_function_result_tupdesc_t(), build_replindex_scan_key(), CheckIndexCompatible(), CheckMyDatabase(), compile_plperl_function(), compile_pltcl_function(), create_pg_locale(), create_pg_locale_builtin(), create_pg_locale_icu(), create_pg_locale_libc(), DeconstructFkConstraintRow(), DropSubscription(), ExecGrant_common(), ExecGrant_Parameter(), expand_stxkind(), extractNotNullColumn(), fetch_function_defaults(), fetch_statentries_for_relation(), fmgr_c_validator(), fmgr_info_C_lang(), fmgr_info_cxt_security(), fmgr_internal_validator(), fmgr_sql_validator(), fmgr_symbol(), func_get_detail(), generateClonedExtStatsStmt(), generateClonedIndexStmt(), get_attstatsslot(), get_db_info(), get_element_property_expr(), get_func_result_name(), get_index_column_opclass(), get_object_namespace(), get_qual_for_range(), getObjectDescription(), getObjectIdentityParts(), GetSubscription(), inclusion_get_strategy_procinfo(), index_create_copy(), index_opclass_options(), inline_function(), inline_function_in_from(), IsIndexUsableForReplicaIdentityFull(), minmax_get_strategy_procinfo(), minmax_multi_get_strategy_procinfo(), object_aclmask_ext(), object_ownercheck(), pg_collation_actual_version(), pg_database_collation_actual_version(), pg_get_constraintdef_worker(), pg_get_functiondef(), pg_get_indexdef_worker(), pg_get_partkeydef_worker(), pg_get_statisticsobj_worker(), pg_get_statisticsobjdef_expressions(), plpgsql_compile_callback(), PLy_procedure_create(), print_function_sqlbody(), ProcedureCreate(), QueueCheckConstraintValidation(), refresh_by_match_merge(), RelationBuildPartitionKey(), RemoveRoleFromInitPriv(), replace_property_refs_mutator(), sql_compile_callback(), test_indoption(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformIndexConstraint(), and TryReuseForeignKey().

◆ SysCacheInvalidate()

void SysCacheInvalidate ( SysCacheIdentifier  cacheId,
uint32  hashValue 
)
extern

Definition at line 691 of file syscache.c.

692{
694 elog(ERROR, "invalid cache ID: %d", cacheId);
695
696 /* if this cache isn't initialized yet, no need to do anything */
697 if (!SysCache[cacheId])
698 return;
699
700 CatCacheInvalidate(SysCache[cacheId], hashValue);
701}
void CatCacheInvalidate(CatCache *cache, uint32 hashValue)
Definition catcache.c:632

References CatCacheInvalidate(), elog, ERROR, fb(), and SysCache.

Referenced by LocalExecuteInvalidationMessage().