PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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 SearchSysCache1(cacheId, key1)   SearchSysCache(cacheId, key1, 0, 0, 0)
 
#define SearchSysCache2(cacheId, key1, key2)   SearchSysCache(cacheId, key1, key2, 0, 0)
 
#define SearchSysCache3(cacheId, key1, key2, key3)   SearchSysCache(cacheId, key1, key2, key3, 0)
 
#define SearchSysCache4(cacheId, key1, key2, key3, key4)   SearchSysCache(cacheId, key1, key2, key3, key4)
 
#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, key1)   GetSysCacheOid(cacheId, key1, 0, 0, 0)
 
#define GetSysCacheOid2(cacheId, key1, key2)   GetSysCacheOid(cacheId, key1, key2, 0, 0)
 
#define GetSysCacheOid3(cacheId, key1, key2, key3)   GetSysCacheOid(cacheId, key1, key2, key3, 0)
 
#define GetSysCacheOid4(cacheId, key1, key2, key3, key4)   GetSysCacheOid(cacheId, 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, 0)
 
#define SearchSysCacheList2(cacheId, key1, key2)   SearchSysCacheList(cacheId, 2, key1, key2, 0, 0)
 
#define SearchSysCacheList3(cacheId, key1, key2, key3)   SearchSysCacheList(cacheId, 3, key1, key2, key3, 0)
 
#define SearchSysCacheList4(cacheId, key1, key2, key3, key4)   SearchSysCacheList(cacheId, 4, key1, key2, key3, key4)
 
#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,
  RANGETYPE, RELNAMENSP, RELOID, REPLORIGIDENT,
  REPLORIGNAME, PUBLICATIONOID, PUBLICATIONNAME, PUBLICATIONREL,
  PUBLICATIONRELMAP, RULERELNAME, SEQRELID, STATRELATTINH,
  SUBSCRIPTIONOID, SUBSCRIPTIONNAME, TABLESPACEOID, TRFOID,
  TRFTYPELANG, TSCONFIGMAP, TSCONFIGNAMENSP, TSCONFIGOID,
  TSDICTNAMENSP, TSDICTOID, TSPARSERNAMENSP, TSPARSEROID,
  TSTEMPLATENAMENSP, TSTEMPLATEOID, TYPENAMENSP, TYPEOID,
  USERMAPPINGOID, USERMAPPINGUSERSERVER
}
 

Functions

void InitCatalogCache (void)
 
void InitCatalogCachePhase2 (void)
 
HeapTuple SearchSysCache (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, 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)
 
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, Datum key4)
 
bool RelationInvalidatesSnapshotsOnly (Oid relid)
 
bool RelationHasSysCache (Oid relid)
 
bool RelationSupportsSysCache (Oid relid)
 

Macro Definition Documentation

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

Definition at line 185 of file syscache.h.

Referenced by record_plan_function_dependency(), and ri_LoadConstraintInfo().

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

Definition at line 187 of file syscache.h.

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

Definition at line 189 of file syscache.h.

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

Definition at line 191 of file syscache.h.

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

Definition at line 182 of file syscache.h.

Referenced by dropOperators(), and dropProcedures().

#define SearchSysCache1 (   cacheId,
  key1 
)    SearchSysCache(cacheId, key1, 0, 0, 0)

Definition at line 149 of file syscache.h.

Referenced by aclitemout(), AggregateCreate(), AlterDomainValidateConstraint(), AlterEnum(), AlterObjectRename_internal(), AlterOpFamily(), AlterSchemaOwner(), AlterSchemaOwner_oid(), AlterTSDictionary(), AlterTypeOwner_oid(), amvalidate(), appendAggOrderBy(), appendFunctionName(), assignOperTypes(), assignProcTypes(), ATAddForeignKeyConstraint(), ATExecAlterColumnGenericOptions(), ATExecChangeOwner(), ATExecDropNotNull(), ATExecSetRelOptions(), ATPostAlterTypeCleanup(), blvalidate(), brinvalidate(), btvalidate(), build_coercion_expression(), BuildIndexValueDescription(), BuildTupleRemapInfo(), CacheInvalidateRelcacheByRelid(), check_amop_signature(), check_amproc_signature(), check_enable_rls(), check_hash_func_signature(), check_role(), check_safe_enum_use(), check_session_authorization(), check_TSCurrentConfig(), CheckFunctionValidatorAccess(), CheckIndexCompatible(), CheckMyDatabase(), cluster(), cluster_rel(), CollationIsVisible(), compile_plperl_function(), compile_pltcl_function(), ComputeIndexAttrs(), 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(), ExecGrant_Database(), ExecGrant_Fdw(), ExecGrant_ForeignServer(), ExecGrant_Function(), ExecGrant_Language(), ExecGrant_Namespace(), ExecGrant_Relation(), ExecGrant_Tablespace(), ExecGrant_Type(), ExecInitAgg(), ExecuteDoStmt(), 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(), format_operator_internal(), format_operator_parts(), format_procedure_internal(), format_procedure_parts(), format_type_internal(), func_get_detail(), func_parallel(), func_strict(), func_volatile(), FunctionIsVisible(), generate_collation_name(), generate_function_name(), generate_operator_name(), generate_partition_qual(), generate_qualified_relation_name(), generate_relation_name(), 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_name(), get_commutator(), get_constraint_name(), get_database_name(), get_db_info(), get_element_type(), get_func_cost(), get_func_leakproof(), get_func_name(), get_func_namespace(), get_func_nargs(), get_func_result_name(), get_func_retset(), get_func_rettype(), get_func_rows(), get_func_signature(), get_func_variadictype(), 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_opcode(), get_oper_expr(), get_opname(), get_oprjoin(), get_oprrest(), get_publication_name(), get_range_subtype(), get_rel_name(), get_rel_namespace(), get_rel_persistence(), get_rel_relkind(), get_rel_tablespace(), get_rel_type_id(), 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(), GetForeignDataWrapper(), GetForeignServer(), GetForeignServerIdByRelId(), GetForeignTable(), GetIndexAmRoutineByAmId(), getObjectDescription(), getObjectIdentityParts(), getOpFamilyDescription(), getOpFamilyIdentity(), getProcedureTypeDescription(), GetPublication(), getRelationDescription(), getRelationIdentity(), GetRelationPublicationActions(), getRelationTypeDescription(), GetSubscription(), GetTSConfigTuple(), getTypeBinaryInputInfo(), getTypeBinaryOutputInfo(), getTypeInputInfo(), getTypeOutputInfo(), GetUserNameFromId(), ginvalidate(), gistproperty(), 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_drop(), 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(), LookupAggNameTypeNames(), LookupTypeName(), make_new_heap(), map_sql_table_to_xmlschema(), map_sql_type_to_xml_name(), mark_index_clustered(), mv_GenerateOper(), 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_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_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_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_sequence_parameters(), pg_subscription_ownercheck(), pg_tablespace_aclmask(), pg_tablespace_ownercheck(), pg_ts_config_ownercheck(), pg_ts_dict_ownercheck(), pg_type_aclmask(), pg_type_ownercheck(), plperl_validator(), plpgsql_build_datatype(), plpgsql_compile(), plpgsql_parse_cwordtype(), plpgsql_validator(), plpython_validator(), PLy_input_tuple_funcs(), PLy_output_tuple_funcs(), PLy_procedure_argument_valid(), PLy_procedure_create(), PLy_procedure_get(), PLy_spi_prepare(), PLyString_ToComposite(), print_function_arguments(), RangeVarCallbackForAlterRelation(), RangeVarCallbackForDropRelation(), RangeVarCallbackForPolicy(), RangeVarCallbackForRenameAttribute(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RangeVarCallbackOwnsRelation(), recomputeNamespacePath(), recordExtObjInitPriv(), regclassout(), regconfigout(), regdictionaryout(), regoperout(), regprocout(), regtypeout(), relation_mark_replica_identity(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationCacheInitializePhase3(), relationHasPrimaryKey(), RelationHasUnloggedIndex(), RelationInitIndexAccessInfo(), RelationIsVisible(), RelationReloadIndexInfo(), RemoveAccessMethodById(), RemoveConstraintById(), RemoveEventTriggerById(), removeExtObjInitPriv(), RemoveForeignDataWrapperById(), RemoveForeignServerById(), RemoveFunctionById(), RemoveObjects(), RemoveOpClassById(), RemoveOperatorById(), RemoveOpFamilyById(), RemovePartitionKeyByRelId(), RemovePublicationById(), RemovePublicationRelById(), RemoveSchemaById(), RemoveTSConfigurationById(), RemoveTSDictionaryById(), RemoveTSParserById(), RemoveTSTemplateById(), RemoveTypeById(), RemoveUserMappingById(), rename_constraint_internal(), RenameConstraint(), RenameRole(), replorigin_by_name(), replorigin_by_oid(), replorigin_drop(), ResetSequence(), ResolveOpClass(), ri_add_cast_to(), ri_GenerateQual(), ri_GenerateQualCollation(), ri_LoadConstraintInfo(), right_oper(), sepgsql_proc_setattr(), sepgsql_relation_setattr(), simplify_function(), spgvalidate(), SPI_gettype(), StorePartitionKey(), superuser_arg(), test_indoption(), transformArrayType(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), triggered_change_notification(), TryReuseForeignKey(), TSConfigIsVisible(), TSDictionaryIsVisible(), TSParserIsVisible(), TSTemplateIsVisible(), TupleDescInitEntry(), typeidType(), typeidTypeRelid(), typeIsOfTypedTable(), TypeIsVisible(), and verify_dictoptions().

#define SearchSysCache4 (   cacheId,
  key1,
  key2,
  key3,
  key4 
)    SearchSysCache(cacheId, key1, key2, key3, key4)
#define SearchSysCacheCopy1 (   cacheId,
  key1 
)    SearchSysCacheCopy(cacheId, key1, 0, 0, 0)

Definition at line 158 of file syscache.h.

Referenced by 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(), ATExecDropColumn(), ATExecDropOf(), ATExecEnableRowSecurity(), ATExecForceNoForceRowSecurity(), ATExecGenericOptions(), ATExecSetTableSpace(), create_toast_table(), CreateTrigger(), DefineQueryRewrite(), do_autovacuum(), examine_attribute(), finish_heap_swap(), get_catalog_object_by_oid(), index_build(), 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(), vac_update_datfrozenxid(), and vac_update_relstats().

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

Definition at line 162 of file syscache.h.

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

Definition at line 164 of file syscache.h.

#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)

Definition at line 173 of file syscache.h.

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

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

Definition at line 196 of file syscache.h.

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

Definition at line 198 of file syscache.h.

Referenced by FindDefaultConversion(), and OpernameGetOprid().

#define SearchSysCacheList4 (   cacheId,
  key1,
  key2,
  key3,
  key4 
)    SearchSysCacheList(cacheId, 4, key1, key2, key3, key4)

Definition at line 200 of file syscache.h.

Enumeration Type Documentation

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 
RANGETYPE 
RELNAMENSP 
RELOID 
REPLORIGIDENT 
REPLORIGNAME 
PUBLICATIONOID 
PUBLICATIONNAME 
PUBLICATIONREL 
PUBLICATIONRELMAP 
RULERELNAME 
SEQRELID 
STATRELATTINH 
SUBSCRIPTIONOID 
SUBSCRIPTIONNAME 
TABLESPACEOID 
TRFOID 
TRFTYPELANG 
TSCONFIGMAP 
TSCONFIGNAMENSP 
TSCONFIGOID 
TSDICTNAMENSP 
TSDICTOID 
TSPARSERNAMENSP 
TSPARSEROID 
TSTEMPLATENAMENSP 
TSTEMPLATEOID 
TYPENAMENSP 
TYPEOID 
USERMAPPINGOID 
USERMAPPINGUSERSERVER 

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,
78  RANGETYPE,
79  RELNAMENSP,
80  RELOID,
88  SEQRELID,
93  TRFOID,
99  TSDICTOID,
101  TSPARSEROID,
104  TYPENAMENSP,
105  TYPEOID,
108 };
Definition: syscache.h:36

Function Documentation

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

Definition at line 1280 of file syscache.c.

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

1285 {
1286  if (cacheId < 0 || cacheId >= SysCacheSize ||
1287  !PointerIsValid(SysCache[cacheId]))
1288  elog(ERROR, "invalid cache ID: %d", cacheId);
1289 
1290  return GetCatCacheHashValue(SysCache[cacheId], key1, key2, key3, key4);
1291 }
#define ERROR
Definition: elog.h:43
#define SysCacheSize
Definition: syscache.c:941
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:943
#define elog
Definition: elog.h:219
uint32 GetCatCacheHashValue(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4)
Definition: catcache.c:1349
#define PointerIsValid(pointer)
Definition: c.h:522
Oid GetSysCacheOid ( int  cacheId,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)

Definition at line 1144 of file syscache.c.

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

1149 {
1150  HeapTuple tuple;
1151  Oid result;
1152 
1153  tuple = SearchSysCache(cacheId, key1, key2, key3, key4);
1154  if (!HeapTupleIsValid(tuple))
1155  return InvalidOid;
1156  result = HeapTupleGetOid(tuple);
1157  ReleaseSysCache(tuple);
1158  return result;
1159 }
HeapTuple SearchSysCache(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
Definition: syscache.c:1065
unsigned int Oid
Definition: postgres_ext.h:31
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1083
#define InvalidOid
Definition: postgres_ext.h:36
#define HeapTupleIsValid(tuple)
Definition: htup.h:77
#define HeapTupleGetOid(tuple)
Definition: htup_details.h:695
void InitCatalogCache ( void  )

Definition at line 967 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, SysCacheRelationOid, SysCacheRelationOidSize, SysCacheSize, SysCacheSupportingRelOid, and SysCacheSupportingRelOidSize.

Referenced by InitPostgres().

968 {
969  int cacheId;
970  int i,
971  j;
972 
974 
976 
977  for (cacheId = 0; cacheId < SysCacheSize; cacheId++)
978  {
979  SysCache[cacheId] = InitCatCache(cacheId,
980  cacheinfo[cacheId].reloid,
981  cacheinfo[cacheId].indoid,
982  cacheinfo[cacheId].nkeys,
983  cacheinfo[cacheId].key,
984  cacheinfo[cacheId].nbuckets);
985  if (!PointerIsValid(SysCache[cacheId]))
986  elog(ERROR, "could not initialize cache %u (%d)",
987  cacheinfo[cacheId].reloid, cacheId);
988  /* Accumulate data for OID lists, too */
990  cacheinfo[cacheId].reloid;
992  cacheinfo[cacheId].reloid;
994  cacheinfo[cacheId].indoid;
995  /* see comments for RelationInvalidatesSnapshotsOnly */
997  }
998 
1001 
1002  /* Sort and de-dup OID arrays, so we can use binary search. */
1004  sizeof(Oid), oid_compare);
1005  for (i = 1, j = 0; i < SysCacheRelationOidSize; i++)
1006  {
1009  }
1010  SysCacheRelationOidSize = j + 1;
1011 
1013  sizeof(Oid), oid_compare);
1014  for (i = 1, j = 0; i < SysCacheSupportingRelOidSize; i++)
1015  {
1018  }
1019  SysCacheSupportingRelOidSize = j + 1;
1020 
1021  CacheInitialized = true;
1022 }
static bool CacheInitialized
Definition: syscache.c:945
static int SysCacheSupportingRelOidSize
Definition: syscache.c:953
static Oid SysCacheSupportingRelOid[SysCacheSize *2]
Definition: syscache.c:952
static int SysCacheRelationOidSize
Definition: syscache.c:949
#define lengthof(array)
Definition: c.h:558
unsigned int Oid
Definition: postgres_ext.h:31
static const struct cachedesc cacheinfo[]
Definition: syscache.c:123
Oid reloid
Definition: syscache.c:116
#define ERROR
Definition: elog.h:43
#define SysCacheSize
Definition: syscache.c:941
CatCache * InitCatCache(int id, Oid reloid, Oid indexoid, int nkeys, const int *key, int nbuckets)
Definition: catcache.c:719
Oid indoid
Definition: syscache.c:117
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:943
static Oid SysCacheRelationOid[SysCacheSize]
Definition: syscache.c:948
#define Assert(condition)
Definition: c.h:671
bool RelationInvalidatesSnapshotsOnly(Oid relid)
Definition: syscache.c:1320
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:1393
int i
#define elog
Definition: elog.h:219
#define PointerIsValid(pointer)
Definition: c.h:522
void InitCatalogCachePhase2 ( void  )

Definition at line 1037 of file syscache.c.

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

Referenced by RelationCacheInitializePhase3().

1038 {
1039  int cacheId;
1040 
1042 
1043  for (cacheId = 0; cacheId < SysCacheSize; cacheId++)
1044  InitCatCachePhase2(SysCache[cacheId], true);
1045 }
static bool CacheInitialized
Definition: syscache.c:945
#define SysCacheSize
Definition: syscache.c:941
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:943
#define Assert(condition)
Definition: c.h:671
void InitCatCachePhase2(CatCache *cache, bool touch_index)
Definition: catcache.c:988
bool RelationHasSysCache ( Oid  relid)

Definition at line 1343 of file syscache.c.

References SysCacheRelationOid, and SysCacheRelationOidSize.

Referenced by GetNonHistoricCatalogSnapshot().

1344 {
1345  int low = 0,
1346  high = SysCacheRelationOidSize - 1;
1347 
1348  while (low <= high)
1349  {
1350  int middle = low + (high - low) / 2;
1351 
1352  if (SysCacheRelationOid[middle] == relid)
1353  return true;
1354  if (SysCacheRelationOid[middle] < relid)
1355  low = middle + 1;
1356  else
1357  high = middle - 1;
1358  }
1359 
1360  return false;
1361 }
static int SysCacheRelationOidSize
Definition: syscache.c:949
static Oid SysCacheRelationOid[SysCacheSize]
Definition: syscache.c:948
bool RelationInvalidatesSnapshotsOnly ( Oid  relid)

Definition at line 1320 of file syscache.c.

References DbRoleSettingRelationId, DependRelationId, DescriptionRelationId, SecLabelRelationId, SharedDependRelationId, SharedDescriptionRelationId, and SharedSecLabelRelationId.

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

1321 {
1322  switch (relid)
1323  {
1325  case DependRelationId:
1327  case DescriptionRelationId:
1329  case SecLabelRelationId:
1331  return true;
1332  default:
1333  break;
1334  }
1335 
1336  return false;
1337 }
#define SharedDependRelationId
Definition: pg_shdepend.h:29
#define DependRelationId
Definition: pg_depend.h:29
#define SharedDescriptionRelationId
#define SharedSecLabelRelationId
Definition: pg_shseclabel.h:21
#define SecLabelRelationId
Definition: pg_seclabel.h:21
#define DescriptionRelationId
#define DbRoleSettingRelationId
bool RelationSupportsSysCache ( Oid  relid)

Definition at line 1368 of file syscache.c.

References SysCacheSupportingRelOid, and SysCacheSupportingRelOidSize.

Referenced by RelationIdIsInInitFile().

1369 {
1370  int low = 0,
1371  high = SysCacheSupportingRelOidSize - 1;
1372 
1373  while (low <= high)
1374  {
1375  int middle = low + (high - low) / 2;
1376 
1377  if (SysCacheSupportingRelOid[middle] == relid)
1378  return true;
1379  if (SysCacheSupportingRelOid[middle] < relid)
1380  low = middle + 1;
1381  else
1382  high = middle - 1;
1383  }
1384 
1385  return false;
1386 }
static int SysCacheSupportingRelOidSize
Definition: syscache.c:953
static Oid SysCacheSupportingRelOid[SysCacheSize *2]
Definition: syscache.c:952
void ReleaseSysCache ( HeapTuple  tuple)

Definition at line 1083 of file syscache.c.

References ReleaseCatCache().

Referenced by aclitemout(), AddEnumLabel(), AddRoleMems(), AggregateCreate(), AlterDomainValidateConstraint(), AlterEnum(), AlterObjectRename_internal(), AlterOpFamily(), AlterRole(), AlterRoleSet(), AlterSchemaOwner(), AlterSchemaOwner_oid(), AlterTSConfiguration(), AlterTSDictionary(), AlterTypeOwner(), AlterTypeOwner_oid(), amvalidate(), appendAggOrderBy(), appendFunctionName(), assignOperTypes(), assignProcTypes(), ATAddForeignKeyConstraint(), ATExecAddColumn(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecChangeOwner(), ATExecDropColumn(), ATExecDropNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATPostAlterTypeCleanup(), ATPrepAlterColumnType(), blvalidate(), brinvalidate(), btcostestimate(), btvalidate(), build_coercion_expression(), BuildIndexValueDescription(), BuildTupleRemapInfo(), CacheInvalidateRelcacheByRelid(), check_amop_signature(), check_amproc_signature(), check_enable_rls(), check_for_column_name_collision(), check_hash_func_signature(), check_role(), check_safe_enum_use(), check_session_authorization(), check_TSCurrentConfig(), CheckFunctionValidatorAccess(), CheckIndexCompatible(), CheckMyDatabase(), 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(), ConstructTupleDescriptor(), ConversionIsVisible(), create_proc_lang(), CreateCast(), CreateFunction(), CreateRole(), CreateSchemaCommand(), 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(), ExecGrant_Attribute(), ExecGrant_Database(), ExecGrant_Fdw(), ExecGrant_ForeignServer(), ExecGrant_Function(), ExecGrant_Language(), ExecGrant_Namespace(), ExecGrant_Relation(), ExecGrant_Tablespace(), ExecGrant_Type(), ExecHashBuildSkewHash(), ExecInitAgg(), ExecuteDoStmt(), expand_all_col_privileges(), 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(), format_operator_internal(), format_operator_parts(), format_procedure_internal(), format_procedure_parts(), format_type_internal(), func_get_detail(), func_parallel(), func_strict(), func_volatile(), FuncNameAsType(), FunctionIsVisible(), generate_collation_name(), generate_function_name(), generate_operator_name(), generate_partition_qual(), generate_qualified_relation_name(), generate_relation_name(), generateClonedIndexStmt(), get_agg_clause_costs_walker(), get_am_name(), get_am_type_oid(), get_array_type(), get_attavgwidth(), get_attname(), get_attnum(), get_attribute_options(), get_attstatsslot(), get_atttype(), get_atttypetypmodcoll(), get_atttypmod(), get_base_element_type(), get_collation(), get_collation_name(), get_commutator(), get_constraint_name(), get_database_name(), get_db_info(), get_default_acl_internal(), get_element_type(), get_func_cost(), get_func_leakproof(), get_func_name(), get_func_namespace(), get_func_nargs(), get_func_result_name(), get_func_retset(), get_func_rettype(), get_func_rows(), get_func_signature(), get_func_variadictype(), 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_opcode(), get_oper_expr(), get_opfamily_member(), get_opfamily_oid(), get_opfamily_proc(), get_opname(), get_oprjoin(), get_oprrest(), get_publication_name(), get_range_subtype(), get_rel_name(), get_rel_namespace(), get_rel_persistence(), get_rel_relkind(), get_rel_tablespace(), get_rel_type_id(), 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(), GetForeignDataWrapper(), GetForeignServer(), GetForeignServerIdByRelId(), GetForeignTable(), GetIndexAmRoutineByAmId(), getObjectDescription(), getObjectIdentityParts(), getOpFamilyDescription(), getOpFamilyIdentity(), getProcedureTypeDescription(), GetPublication(), getRelationDescription(), getRelationIdentity(), GetRelationPublicationActions(), getRelationTypeDescription(), GetSubscription(), GetSysCacheOid(), getTypeBinaryInputInfo(), getTypeBinaryOutputInfo(), getTypeInputInfo(), getTypeOutputInfo(), GetUserMapping(), GetUserNameFromId(), ginvalidate(), gistproperty(), 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_drop(), 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_cache(), lookup_ts_config_cache(), lookup_ts_dictionary_cache(), lookup_ts_parser_cache(), lookup_type_cache(), LookupAggNameTypeNames(), LookupTypeNameOid(), 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(), mv_GenerateOper(), 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_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_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_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_sequence_parameters(), pg_subscription_ownercheck(), pg_tablespace_aclmask(), pg_tablespace_ownercheck(), pg_ts_config_ownercheck(), pg_ts_dict_ownercheck(), pg_type_aclmask(), pg_type_ownercheck(), plperl_validator(), plpgsql_build_datatype(), plpgsql_compile(), plpgsql_parse_cwordtype(), plpgsql_parse_wordtype(), plpgsql_validator(), plpython_validator(), PLy_input_tuple_funcs(), PLy_output_tuple_funcs(), PLy_procedure_argument_valid(), PLy_procedure_create(), PLy_procedure_get(), PLy_spi_prepare(), PLyString_ToComposite(), print_function_arguments(), ProcedureCreate(), RangeVarCallbackForAlterRelation(), RangeVarCallbackForDropRelation(), RangeVarCallbackForPolicy(), RangeVarCallbackForRenameAttribute(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RangeVarCallbackOwnsRelation(), recomputeNamespacePath(), recordExtObjInitPriv(), regclassout(), regconfigout(), regdictionaryout(), regoperout(), regprocout(), regtypeout(), relation_mark_replica_identity(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationCacheInitializePhase3(), relationHasPrimaryKey(), RelationHasUnloggedIndex(), RelationInitIndexAccessInfo(), RelationIsVisible(), RelationReloadIndexInfo(), RemoveAccessMethodById(), RemoveConstraintById(), RemoveEventTriggerById(), removeExtObjInitPriv(), RemoveForeignDataWrapperById(), RemoveForeignServerById(), RemoveFunctionById(), RemoveObjects(), RemoveOpClassById(), RemoveOperatorById(), RemoveOpFamilyById(), RemovePartitionKeyByRelId(), RemovePublicationById(), RemovePublicationRelById(), RemoveSchemaById(), RemoveTSConfigurationById(), RemoveTSDictionaryById(), RemoveTSParserById(), RemoveTSTemplateById(), RemoveTypeById(), RemoveUserMappingById(), rename_constraint_internal(), RenameConstraint(), RenameRole(), replorigin_by_name(), replorigin_by_oid(), replorigin_drop(), ResetSequence(), ResolveOpClass(), ri_add_cast_to(), ri_GenerateQual(), ri_GenerateQualCollation(), ri_LoadConstraintInfo(), SearchSysCacheAttName(), SearchSysCacheCopy(), SearchSysCacheCopyAttName(), SearchSysCacheExists(), SearchSysCacheExistsAttName(), sepgsql_proc_setattr(), sepgsql_relation_setattr(), SetDefaultACL(), simplify_function(), spgvalidate(), SPI_gettype(), superuser_arg(), test_indoption(), transformArrayType(), transformColumnNameList(), transformColumnType(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformOfType(), triggered_change_notification(), TryReuseForeignKey(), TSConfigIsVisible(), TSDictionaryIsVisible(), TSParserIsVisible(), TSTemplateIsVisible(), TupleDescInitEntry(), typeidTypeRelid(), typeIsOfTypedTable(), TypeIsVisible(), typenameTypeId(), typenameTypeIdAndMod(), update_attstats(), and verify_dictoptions().

1084 {
1085  ReleaseCatCache(tuple);
1086 }
void ReleaseCatCache(HeapTuple tuple)
Definition: catcache.c:1317
HeapTuple SearchSysCache ( int  cacheId,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)

Definition at line 1065 of file syscache.c.

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

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

1070 {
1071  if (cacheId < 0 || cacheId >= SysCacheSize ||
1072  !PointerIsValid(SysCache[cacheId]))
1073  elog(ERROR, "invalid cache ID: %d", cacheId);
1074 
1075  return SearchCatCache(SysCache[cacheId], key1, key2, key3, key4);
1076 }
#define ERROR
Definition: elog.h:43
#define SysCacheSize
Definition: syscache.c:941
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:943
HeapTuple SearchCatCache(CatCache *cache, Datum v1, Datum v2, Datum v3, Datum v4)
Definition: catcache.c:1103
#define elog
Definition: elog.h:219
#define PointerIsValid(pointer)
Definition: c.h:522
HeapTuple SearchSysCacheAttName ( Oid  relid,
const char *  attname 
)

Definition at line 1171 of file syscache.c.

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

Referenced by ATExecAlterColumnGenericOptions(), ATExecDropColumn(), ATExecSetOptions(), ATPrepAlterColumnType(), ComputeIndexAttrs(), ComputePartitionAttrs(), get_attnum(), plpgsql_parse_cwordtype(), SearchSysCacheCopyAttName(), SearchSysCacheExistsAttName(), and transformColumnNameList().

1172 {
1173  HeapTuple tuple;
1174 
1175  tuple = SearchSysCache2(ATTNAME,
1176  ObjectIdGetDatum(relid),
1177  CStringGetDatum(attname));
1178  if (!HeapTupleIsValid(tuple))
1179  return NULL;
1180  if (((Form_pg_attribute) GETSTRUCT(tuple))->attisdropped)
1181  {
1182  ReleaseSysCache(tuple);
1183  return NULL;
1184  }
1185  return tuple;
1186 }
#define GETSTRUCT(TUP)
Definition: htup_details.h:656
#define ObjectIdGetDatum(X)
Definition: postgres.h:515
#define CStringGetDatum(X)
Definition: postgres.h:586
FormData_pg_attribute * Form_pg_attribute
Definition: pg_attribute.h:184
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1083
#define HeapTupleIsValid(tuple)
Definition: htup.h:77
#define NULL
Definition: c.h:226
#define SearchSysCache2(cacheId, key1, key2)
Definition: syscache.h:151
HeapTuple SearchSysCacheCopy ( int  cacheId,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)

Definition at line 1097 of file syscache.c.

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

1102 {
1103  HeapTuple tuple,
1104  newtuple;
1105 
1106  tuple = SearchSysCache(cacheId, key1, key2, key3, key4);
1107  if (!HeapTupleIsValid(tuple))
1108  return tuple;
1109  newtuple = heap_copytuple(tuple);
1110  ReleaseSysCache(tuple);
1111  return newtuple;
1112 }
HeapTuple SearchSysCache(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
Definition: syscache.c:1065
HeapTuple heap_copytuple(HeapTuple tuple)
Definition: heaptuple.c:608
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1083
#define HeapTupleIsValid(tuple)
Definition: htup.h:77
HeapTuple SearchSysCacheCopyAttName ( Oid  relid,
const char *  attname 
)

Definition at line 1194 of file syscache.c.

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

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

1195 {
1196  HeapTuple tuple,
1197  newtuple;
1198 
1199  tuple = SearchSysCacheAttName(relid, attname);
1200  if (!HeapTupleIsValid(tuple))
1201  return tuple;
1202  newtuple = heap_copytuple(tuple);
1203  ReleaseSysCache(tuple);
1204  return newtuple;
1205 }
HeapTuple heap_copytuple(HeapTuple tuple)
Definition: heaptuple.c:608
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1083
#define HeapTupleIsValid(tuple)
Definition: htup.h:77
HeapTuple SearchSysCacheAttName(Oid relid, const char *attname)
Definition: syscache.c:1171
bool SearchSysCacheExists ( int  cacheId,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)

Definition at line 1121 of file syscache.c.

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

1126 {
1127  HeapTuple tuple;
1128 
1129  tuple = SearchSysCache(cacheId, key1, key2, key3, key4);
1130  if (!HeapTupleIsValid(tuple))
1131  return false;
1132  ReleaseSysCache(tuple);
1133  return true;
1134 }
HeapTuple SearchSysCache(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4)
Definition: syscache.c:1065
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1083
#define HeapTupleIsValid(tuple)
Definition: htup.h:77
bool SearchSysCacheExistsAttName ( Oid  relid,
const char *  attname 
)

Definition at line 1213 of file syscache.c.

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

Referenced by RemoveInheritance().

1214 {
1215  HeapTuple tuple;
1216 
1217  tuple = SearchSysCacheAttName(relid, attname);
1218  if (!HeapTupleIsValid(tuple))
1219  return false;
1220  ReleaseSysCache(tuple);
1221  return true;
1222 }
void ReleaseSysCache(HeapTuple tuple)
Definition: syscache.c:1083
#define HeapTupleIsValid(tuple)
Definition: htup.h:77
HeapTuple SearchSysCacheAttName(Oid relid, const char *attname)
Definition: syscache.c:1171
struct catclist* SearchSysCacheList ( int  cacheId,
int  nkeys,
Datum  key1,
Datum  key2,
Datum  key3,
Datum  key4 
)

Definition at line 1297 of file syscache.c.

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

1299 {
1300  if (cacheId < 0 || cacheId >= SysCacheSize ||
1301  !PointerIsValid(SysCache[cacheId]))
1302  elog(ERROR, "invalid cache ID: %d", cacheId);
1303 
1304  return SearchCatCacheList(SysCache[cacheId], nkeys,
1305  key1, key2, key3, key4);
1306 }
#define ERROR
Definition: elog.h:43
#define SysCacheSize
Definition: syscache.c:941
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:943
CatCList * SearchCatCacheList(CatCache *cache, int nkeys, Datum v1, Datum v2, Datum v3, Datum v4)
Definition: catcache.c:1389
#define elog
Definition: elog.h:219
#define PointerIsValid(pointer)
Definition: c.h:522
Datum SysCacheGetAttr ( int  cacheId,
HeapTuple  tup,
AttrNumber  attributeNumber,
bool isNull 
)

Definition at line 1245 of file syscache.c.

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

Referenced by AlterDomainValidateConstraint(), AlterForeignDataWrapper(), AlterForeignServer(), AlterFunction(), AlterRole(), AlterSchemaOwner_internal(), AlterTSDictionary(), AlterUserMapping(), ATExecAlterColumnGenericOptions(), ATExecChangeOwner(), ATExecDetachPartition(), ATExecGenericOptions(), ATExecSetOptions(), ATExecSetRelOptions(), build_function_result_tupdesc_t(), build_replindex_scan_key(), CheckIndexCompatible(), compile_plperl_function(), compile_pltcl_function(), DefineDomain(), do_compile(), DropSubscription(), ExecGrant_Attribute(), ExecGrant_Fdw(), ExecGrant_ForeignServer(), ExecGrant_Function(), ExecGrant_Language(), ExecGrant_Namespace(), ExecGrant_Relation(), ExecInitAgg(), fetch_function_defaults(), flatten_reloptions(), fmgr_c_validator(), fmgr_info_C_lang(), fmgr_info_cxt_security(), fmgr_internal_validator(), fmgr_security_definer(), fmgr_sql_validator(), func_get_detail(), generate_partition_qual(), generateClonedIndexStmt(), get_attribute_options(), get_attstatsslot(), get_default_acl_internal(), get_func_arg_info(), get_func_result_name(), get_func_trftypes(), get_object_namespace(), get_role_password(), get_tablespace(), get_typdefault(), GetForeignColumnOptions(), GetForeignDataWrapper(), GetForeignServer(), GetForeignTable(), GetSubscription(), GetUserMapping(), gistproperty(), inclusion_get_strategy_procinfo(), 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_language_aclmask(), pg_namespace_aclmask(), pg_proc_aclmask(), pg_tablespace_aclmask(), pg_type_aclmask(), PLy_procedure_create(), prepare_sql_fn_parse_info(), print_function_arguments(), ProcedureCreate(), recordExtObjInitPriv(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), ri_LoadConstraintInfo(), SetDefaultACL(), StorePartitionBound(), test_indoption(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformIndexConstraint(), TryReuseForeignKey(), and validateCheckConstraint().

1248 {
1249  /*
1250  * We just need to get the TupleDesc out of the cache entry, and then we
1251  * can apply heap_getattr(). Normally the cache control data is already
1252  * valid (because the caller recently fetched the tuple via this same
1253  * cache), but there are cases where we have to initialize the cache here.
1254  */
1255  if (cacheId < 0 || cacheId >= SysCacheSize ||
1256  !PointerIsValid(SysCache[cacheId]))
1257  elog(ERROR, "invalid cache ID: %d", cacheId);
1258  if (!PointerIsValid(SysCache[cacheId]->cc_tupdesc))
1259  {
1260  InitCatCachePhase2(SysCache[cacheId], false);
1261  Assert(PointerIsValid(SysCache[cacheId]->cc_tupdesc));
1262  }
1263 
1264  return heap_getattr(tup, attributeNumber,
1265  SysCache[cacheId]->cc_tupdesc,
1266  isNull);
1267 }
#define ERROR
Definition: elog.h:43
#define SysCacheSize
Definition: syscache.c:941
#define heap_getattr(tup, attnum, tupleDesc, isnull)
Definition: htup_details.h:769
static CatCache * SysCache[SysCacheSize]
Definition: syscache.c:943
#define Assert(condition)
Definition: c.h:671
#define elog
Definition: elog.h:219
void InitCatCachePhase2(CatCache *cache, bool touch_index)
Definition: catcache.c:988
#define PointerIsValid(pointer)
Definition: c.h:522