PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | TypeCacheEntry |
struct | DomainConstraintRef |
Macros | |
#define | TYPECACHE_EQ_OPR 0x00001 |
#define | TYPECACHE_LT_OPR 0x00002 |
#define | TYPECACHE_GT_OPR 0x00004 |
#define | TYPECACHE_CMP_PROC 0x00008 |
#define | TYPECACHE_HASH_PROC 0x00010 |
#define | TYPECACHE_EQ_OPR_FINFO 0x00020 |
#define | TYPECACHE_CMP_PROC_FINFO 0x00040 |
#define | TYPECACHE_HASH_PROC_FINFO 0x00080 |
#define | TYPECACHE_TUPDESC 0x00100 |
#define | TYPECACHE_BTREE_OPFAMILY 0x00200 |
#define | TYPECACHE_HASH_OPFAMILY 0x00400 |
#define | TYPECACHE_RANGE_INFO 0x00800 |
#define | TYPECACHE_DOMAIN_BASE_INFO 0x01000 |
#define | TYPECACHE_DOMAIN_CONSTR_INFO 0x02000 |
#define | TYPECACHE_HASH_EXTENDED_PROC 0x04000 |
#define | TYPECACHE_HASH_EXTENDED_PROC_FINFO 0x08000 |
#define | TYPECACHE_MULTIRANGE_INFO 0x10000 |
#define | INVALID_TUPLEDESC_IDENTIFIER ((uint64) 1) |
Typedefs | |
typedef struct DomainConstraintCache | DomainConstraintCache |
typedef struct TypeCacheEntry | TypeCacheEntry |
typedef struct DomainConstraintRef | DomainConstraintRef |
typedef struct SharedRecordTypmodRegistry | SharedRecordTypmodRegistry |
Functions | |
TypeCacheEntry * | lookup_type_cache (Oid type_id, int flags) |
void | InitDomainConstraintRef (Oid type_id, DomainConstraintRef *ref, MemoryContext refctx, bool need_exprstate) |
void | UpdateDomainConstraintRef (DomainConstraintRef *ref) |
bool | DomainHasConstraints (Oid type_id) |
TupleDesc | lookup_rowtype_tupdesc (Oid type_id, int32 typmod) |
TupleDesc | lookup_rowtype_tupdesc_noerror (Oid type_id, int32 typmod, bool noError) |
TupleDesc | lookup_rowtype_tupdesc_copy (Oid type_id, int32 typmod) |
TupleDesc | lookup_rowtype_tupdesc_domain (Oid type_id, int32 typmod, bool noError) |
void | assign_record_type_typmod (TupleDesc tupDesc) |
uint64 | assign_record_type_identifier (Oid type_id, int32 typmod) |
int | compare_values_of_enum (TypeCacheEntry *tcache, Oid arg1, Oid arg2) |
size_t | SharedRecordTypmodRegistryEstimate (void) |
void | SharedRecordTypmodRegistryInit (SharedRecordTypmodRegistry *, dsm_segment *segment, dsa_area *area) |
void | SharedRecordTypmodRegistryAttach (SharedRecordTypmodRegistry *) |
#define INVALID_TUPLEDESC_IDENTIFIER ((uint64) 1) |
Definition at line 156 of file typcache.h.
#define TYPECACHE_BTREE_OPFAMILY 0x00200 |
Definition at line 146 of file typcache.h.
#define TYPECACHE_CMP_PROC 0x00008 |
Definition at line 140 of file typcache.h.
#define TYPECACHE_CMP_PROC_FINFO 0x00040 |
Definition at line 143 of file typcache.h.
#define TYPECACHE_DOMAIN_BASE_INFO 0x01000 |
Definition at line 149 of file typcache.h.
#define TYPECACHE_DOMAIN_CONSTR_INFO 0x02000 |
Definition at line 150 of file typcache.h.
#define TYPECACHE_EQ_OPR 0x00001 |
Definition at line 137 of file typcache.h.
#define TYPECACHE_EQ_OPR_FINFO 0x00020 |
Definition at line 142 of file typcache.h.
#define TYPECACHE_GT_OPR 0x00004 |
Definition at line 139 of file typcache.h.
#define TYPECACHE_HASH_EXTENDED_PROC 0x04000 |
Definition at line 151 of file typcache.h.
#define TYPECACHE_HASH_EXTENDED_PROC_FINFO 0x08000 |
Definition at line 152 of file typcache.h.
#define TYPECACHE_HASH_OPFAMILY 0x00400 |
Definition at line 147 of file typcache.h.
#define TYPECACHE_HASH_PROC 0x00010 |
Definition at line 141 of file typcache.h.
#define TYPECACHE_HASH_PROC_FINFO 0x00080 |
Definition at line 144 of file typcache.h.
#define TYPECACHE_LT_OPR 0x00002 |
Definition at line 138 of file typcache.h.
#define TYPECACHE_MULTIRANGE_INFO 0x10000 |
Definition at line 153 of file typcache.h.
#define TYPECACHE_RANGE_INFO 0x00800 |
Definition at line 148 of file typcache.h.
#define TYPECACHE_TUPDESC 0x00100 |
Definition at line 145 of file typcache.h.
typedef struct DomainConstraintCache DomainConstraintCache |
Definition at line 1 of file typcache.h.
typedef struct DomainConstraintRef DomainConstraintRef |
typedef struct SharedRecordTypmodRegistry SharedRecordTypmodRegistry |
Definition at line 1 of file typcache.h.
typedef struct TypeCacheEntry TypeCacheEntry |
Definition at line 2062 of file typcache.c.
References Assert, ereport, errcode(), errmsg(), ERROR, format_type_be(), RecordCacheArrayEntry::id, lookup_type_cache(), RecordCacheArray, RecordCacheArrayLen, TypeCacheEntry::tupDesc, TypeCacheEntry::tupDesc_identifier, tupledesc_id_counter, and TYPECACHE_TUPDESC.
Referenced by expanded_record_fetch_tupdesc(), make_expanded_record_from_tupdesc(), and make_expanded_record_from_typeid().
void assign_record_type_typmod | ( | TupleDesc | tupDesc | ) |
Definition at line 1970 of file typcache.c.
References Assert, CacheMemoryContext, CreateCacheMemoryContext(), CreateTupleDescCopy(), ctl, ensure_record_cache_typmod_slot_exists(), find_or_make_matching_shared_tupledesc(), HASH_COMPARE, hash_create(), HASH_ELEM, HASH_ENTER, HASH_FIND, HASH_FUNCTION, hash_search(), RecordCacheArrayEntry::id, MemoryContextSwitchTo(), NextRecordTypmod, record_type_typmod_compare(), record_type_typmod_hash(), RecordCacheArray, RecordCacheHash, TupleDescData::tdrefcount, TupleDescData::tdtypeid, TupleDescData::tdtypmod, RecordCacheEntry::tupdesc, RecordCacheArrayEntry::tupdesc, and tupledesc_id_counter.
Referenced by BlessTupleDesc(), ER_get_flat_size(), internal_get_result_type(), and SPI_returntuple().
int compare_values_of_enum | ( | TypeCacheEntry * | tcache, |
Oid | arg1, | ||
Oid | arg2 | ||
) |
Definition at line 2502 of file typcache.c.
References elog, enum_known_sorted(), TypeCacheEntry::enumData, ERROR, find_enumitem(), format_type_be(), load_enum_cache_data(), EnumItem::sort_order, and TypeCacheEntry::type_id.
Referenced by enum_cmp_internal().
Definition at line 1417 of file typcache.c.
References TypeCacheEntry::domainData, lookup_type_cache(), and TYPECACHE_DOMAIN_CONSTR_INFO.
Referenced by ATColumnChangeRequiresRewrite(), ATExecAddColumn(), eval_const_expressions_mutator(), ExecInitJsonCoercion(), and transformJsonFuncExpr().
void InitDomainConstraintRef | ( | Oid | type_id, |
DomainConstraintRef * | ref, | ||
MemoryContext | refctx, | ||
bool | need_exprstate | ||
) |
Definition at line 1330 of file typcache.c.
References MemoryContextCallback::arg, DomainConstraintRef::callback, DomainConstraintCache::constraints, DomainConstraintRef::constraints, DomainConstraintRef::dcc, dccref_deletion_callback(), DomainConstraintCache::dccRefCount, TypeCacheEntry::domainData, MemoryContextCallback::func, lookup_type_cache(), MemoryContextRegisterResetCallback(), DomainConstraintRef::need_exprstate, NIL, prep_domain_constraints(), DomainConstraintRef::refctx, DomainConstraintRef::tcache, and TYPECACHE_DOMAIN_CONSTR_INFO.
Referenced by domain_state_setup(), and ExecInitCoerceToDomain().
Definition at line 1850 of file typcache.c.
References lookup_rowtype_tupdesc_internal(), and PinTupleDesc.
Referenced by ATExecAddOf(), coerce_record_to_complex(), composite_to_json(), composite_to_jsonb(), deconstruct_composite_datum(), exec_move_row_from_datum(), ExecInitExprRec(), ExecuteCallStmt(), expanded_record_fetch_tupdesc(), get_cached_rowtype(), get_rule_expr(), GetAttributeByName(), GetAttributeByNum(), hash_record(), hash_record_extended(), HeapTupleHeaderGetDatum(), make_expanded_record_from_typeid(), make_tuple_indirect(), plperl_hash_from_datum(), pltcl_func_handler(), PLyDict_FromComposite(), PLyObject_ToComposite(), record_cmp(), record_eq(), record_image_cmp(), record_image_eq(), record_in(), record_out(), record_recv(), record_send(), transformOfType(), and update_cached_tupdesc().
Definition at line 1884 of file typcache.c.
References CreateTupleDescCopyConstr(), and lookup_rowtype_tupdesc_internal().
Referenced by ExecInitExprRec(), ExecMakeTableFunctionResult(), get_expr_result_type(), internal_get_result_type(), and TypeGetTupleDesc().
Definition at line 1906 of file typcache.c.
References TypeCacheEntry::domainBaseType, TypeCacheEntry::domainBaseTypmod, ereport, errcode(), errmsg(), ERROR, format_type_be(), lookup_rowtype_tupdesc_internal(), lookup_rowtype_tupdesc_noerror(), lookup_type_cache(), PinTupleDesc, TypeCacheEntry::tupDesc, TYPECACHE_DOMAIN_BASE_INFO, TYPECACHE_TUPDESC, and TypeCacheEntry::typtype.
Referenced by ExecEvalWholeRowVar(), hstore_from_record(), hstore_populate_record(), plperl_sv_to_datum(), and rowtype_field_matches().
Definition at line 1867 of file typcache.c.
References lookup_rowtype_tupdesc_internal(), and PinTupleDesc.
Referenced by lookup_rowtype_tupdesc_domain().
TypeCacheEntry* lookup_type_cache | ( | Oid | type_id, |
int | flags | ||
) |
Definition at line 356 of file typcache.c.
References array_element_has_compare(), array_element_has_equality(), array_element_has_extended_hashing(), array_element_has_hashing(), Assert, BTEqualStrategyNumber, BTGreaterStrategyNumber, BTLessStrategyNumber, BTORDER_PROC, TypeCacheEntry::btree_opf, TypeCacheEntry::btree_opintype, CacheMemoryContext, CacheRegisterRelcacheCallback(), CacheRegisterSyscacheCallback(), TypeCacheEntry::cmp_proc, TypeCacheEntry::cmp_proc_finfo, CreateCacheMemoryContext(), ctl, TypeCacheEntry::domainBaseType, TypeCacheEntry::domainBaseTypmod, TypeCacheEntry::eq_opr, TypeCacheEntry::eq_opr_finfo, ereport, errcode(), errmsg(), ERROR, firstDomainTypeEntry, TypeCacheEntry::flags, fmgr_info_cxt(), FmgrInfo::fn_oid, get_hash_value(), get_opclass_family(), get_opclass_input_type(), get_opcode(), get_opfamily_member(), get_opfamily_proc(), getBaseTypeAndTypmod(), GetDefaultOpClass(), GETSTRUCT, TypeCacheEntry::gt_opr, hash_create(), HASH_ELEM, HASH_ENTER, TypeCacheEntry::hash_extended_proc, TypeCacheEntry::hash_extended_proc_finfo, HASH_FIND, HASH_FUNCTION, TypeCacheEntry::hash_opf, TypeCacheEntry::hash_opintype, TypeCacheEntry::hash_proc, TypeCacheEntry::hash_proc_finfo, hash_search(), HASHEXTENDED_PROC, HASHSTANDARD_PROC, HeapTupleIsValid, HTEqualStrategyNumber, InvalidOid, load_domaintype_info(), load_multirangetype_info(), load_rangetype_info(), load_typcache_tupdesc(), TypeCacheEntry::lt_opr, MemSet, multirange_element_has_extended_hashing(), multirange_element_has_hashing(), NameStr, TypeCacheEntry::nextDomain, ObjectIdGetDatum(), OidIsValid, range_element_has_extended_hashing(), range_element_has_hashing(), record_fields_have_compare(), record_fields_have_equality(), record_fields_have_extended_hashing(), record_fields_have_hashing(), ReleaseSysCache(), TypeCacheEntry::rngelemtype, TypeCacheEntry::rngtype, SearchSysCache1(), TCFLAGS_CHECKED_BTREE_OPCLASS, TCFLAGS_CHECKED_CMP_PROC, TCFLAGS_CHECKED_DOMAIN_CONSTRAINTS, TCFLAGS_CHECKED_EQ_OPR, TCFLAGS_CHECKED_GT_OPR, TCFLAGS_CHECKED_HASH_EXTENDED_PROC, TCFLAGS_CHECKED_HASH_OPCLASS, TCFLAGS_CHECKED_HASH_PROC, TCFLAGS_CHECKED_LT_OPR, TCFLAGS_HAVE_PG_TYPE_DATA, TypeCacheEntry::tupDesc, TypeCacheEntry::typalign, TypeCacheEntry::typbyval, TypeCacheEntry::typcollation, type_cache_syshash(), TypeCacheEntry::type_id, TypeCacheEntry::type_id_hash, TYPECACHE_BTREE_OPFAMILY, TYPECACHE_CMP_PROC, TYPECACHE_CMP_PROC_FINFO, TYPECACHE_DOMAIN_BASE_INFO, TYPECACHE_DOMAIN_CONSTR_INFO, TYPECACHE_EQ_OPR, TYPECACHE_EQ_OPR_FINFO, TYPECACHE_GT_OPR, TYPECACHE_HASH_EXTENDED_PROC, TYPECACHE_HASH_EXTENDED_PROC_FINFO, TYPECACHE_HASH_OPFAMILY, TYPECACHE_HASH_PROC, TYPECACHE_HASH_PROC_FINFO, TYPECACHE_LT_OPR, TYPECACHE_MULTIRANGE_INFO, TYPECACHE_RANGE_INFO, TYPECACHE_TUPDESC, TypeCacheConstrCallback(), TypeCacheHash, TypeCacheOpcCallback(), TypeCacheRelCallback(), TypeCacheTypCallback(), TypeCacheEntry::typelem, TypeCacheEntry::typlen, TypeCacheEntry::typrelid, TypeCacheEntry::typstorage, TypeCacheEntry::typsubscript, and TypeCacheEntry::typtype.
Referenced by analyzeCTE(), appendOrderBySuffix(), array_cmp(), array_contain_compare(), array_eq(), array_position_common(), array_positions(), array_replace_internal(), array_sample(), array_shuffle(), array_typanalyze(), assign_record_type_identifier(), brin_bloom_opcinfo(), brin_inclusion_opcinfo(), brin_minmax_multi_opcinfo(), brin_minmax_opcinfo(), build_datatype(), build_mss(), cache_array_element_properties(), cache_multirange_element_properties(), cache_range_element_properties(), cache_record_field_properties(), calc_arraycontsel(), check_memoizable(), contain_leaked_vars_walker(), CreateStatistics(), dependency_degree(), domain_state_setup(), DomainHasConstraints(), enum_cmp_internal(), ExecInitExprRec(), find_simplified_clause(), foreign_expr_walker(), get_cached_rowtype(), get_multirange_io_data(), get_range_io_data(), get_rule_orderby(), get_sort_group_operators(), hash_array(), hash_array_extended(), hash_multirange(), hash_multirange_extended(), hash_range(), hash_range_extended(), hash_record(), hash_record_extended(), InitDomainConstraintRef(), initGinState(), load_multirangetype_info(), load_rangetype_info(), lookup_rowtype_tupdesc_domain(), lookup_rowtype_tupdesc_internal(), make_expanded_record_from_tupdesc(), make_expanded_record_from_typeid(), multirange_get_typcache(), multirange_unnest(), ndistinct_for_combination(), op_hashjoinable(), op_mergejoinable(), paraminfo_get_equal_hashops(), PLy_input_setup_func(), PLy_output_setup_func(), range_get_typcache(), record_cmp(), record_eq(), revalidate_rectypeid(), scalararraysel(), scalararraysel_containment(), show_sortorder_options(), statext_mcv_serialize(), tuples_equal(), and width_bucket_array().
void SharedRecordTypmodRegistryAttach | ( | SharedRecordTypmodRegistry * | registry | ) |
Definition at line 2224 of file typcache.c.
References Session::area, Assert, CurrentSession, dshash_attach(), IsParallelWorker, MemoryContextSwitchTo(), NextRecordTypmod, on_dsm_detach(), PointerGetDatum(), SharedRecordTypmodRegistry::record_table_handle, Session::segment, Session::shared_record_table, shared_record_typmod_registry_detach(), Session::shared_typmod_registry, Session::shared_typmod_table, srtr_record_table_params, srtr_typmod_table_params, TopMemoryContext, and SharedRecordTypmodRegistry::typmod_table_handle.
Referenced by AttachSession().
size_t SharedRecordTypmodRegistryEstimate | ( | void | ) |
Definition at line 2103 of file typcache.c.
Referenced by GetSessionDsmHandle().
void SharedRecordTypmodRegistryInit | ( | SharedRecordTypmodRegistry * | registry, |
dsm_segment * | segment, | ||
dsa_area * | area | ||
) |
Definition at line 2125 of file typcache.c.
References Assert, CurrentSession, dshash_create(), dshash_find_or_insert(), dshash_get_hash_table_handle(), dshash_release_lock(), elog, ERROR, IsParallelWorker, SharedRecordTableEntry::key, SharedRecordTableKey::local_tupdesc, MemoryContextSwitchTo(), SharedRecordTypmodRegistry::next_typmod, NextRecordTypmod, on_dsm_detach(), pg_atomic_init_u32(), SharedRecordTypmodRegistry::record_table_handle, RecordCacheArray, share_tupledesc(), SharedRecordTableKey::shared, Session::shared_record_table, shared_record_typmod_registry_detach(), SharedRecordTableKey::shared_tupdesc, SharedTypmodTableEntry::shared_tupdesc, Session::shared_typmod_registry, Session::shared_typmod_table, srtr_record_table_params, srtr_typmod_table_params, TupleDescData::tdtypmod, TopMemoryContext, RecordCacheArrayEntry::tupdesc, SharedTypmodTableEntry::typmod, SharedRecordTypmodRegistry::typmod_table_handle, and SharedRecordTableKey::u.
Referenced by GetSessionDsmHandle().
void UpdateDomainConstraintRef | ( | DomainConstraintRef * | ref | ) |
Definition at line 1368 of file typcache.c.
References DomainConstraintCache::constraints, DomainConstraintRef::constraints, DomainConstraintRef::dcc, DomainConstraintCache::dccRefCount, decr_dcc_refcount(), TypeCacheEntry::domainData, TypeCacheEntry::flags, load_domaintype_info(), DomainConstraintRef::need_exprstate, NIL, prep_domain_constraints(), DomainConstraintRef::refctx, DomainConstraintRef::tcache, TCFLAGS_CHECKED_DOMAIN_CONSTRAINTS, and TypeCacheEntry::typtype.
Referenced by domain_check_input().