PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <limits.h>
#include "access/hash.h"
#include "access/htup_details.h"
#include "access/nbtree.h"
#include "access/parallel.h"
#include "access/relation.h"
#include "access/session.h"
#include "access/table.h"
#include "catalog/pg_am.h"
#include "catalog/pg_constraint.h"
#include "catalog/pg_enum.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_range.h"
#include "catalog/pg_type.h"
#include "commands/defrem.h"
#include "common/int.h"
#include "executor/executor.h"
#include "lib/dshash.h"
#include "optimizer/optimizer.h"
#include "port/pg_bitutils.h"
#include "storage/lwlock.h"
#include "utils/builtins.h"
#include "utils/catcache.h"
#include "utils/fmgroids.h"
#include "utils/injection_point.h"
#include "utils/inval.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/rel.h"
#include "utils/syscache.h"
#include "utils/typcache.h"
Go to the source code of this file.
Data Structures | |
struct | RelIdToTypeIdCacheEntry |
struct | DomainConstraintCache |
struct | EnumItem |
struct | TypeCacheEnumData |
struct | RecordCacheEntry |
struct | SharedRecordTypmodRegistry |
struct | SharedRecordTableKey |
struct | SharedRecordTableEntry |
struct | SharedTypmodTableEntry |
struct | RecordCacheArrayEntry |
Macros | |
#define | TCFLAGS_HAVE_PG_TYPE_DATA 0x000001 |
#define | TCFLAGS_CHECKED_BTREE_OPCLASS 0x000002 |
#define | TCFLAGS_CHECKED_HASH_OPCLASS 0x000004 |
#define | TCFLAGS_CHECKED_EQ_OPR 0x000008 |
#define | TCFLAGS_CHECKED_LT_OPR 0x000010 |
#define | TCFLAGS_CHECKED_GT_OPR 0x000020 |
#define | TCFLAGS_CHECKED_CMP_PROC 0x000040 |
#define | TCFLAGS_CHECKED_HASH_PROC 0x000080 |
#define | TCFLAGS_CHECKED_HASH_EXTENDED_PROC 0x000100 |
#define | TCFLAGS_CHECKED_ELEM_PROPERTIES 0x000200 |
#define | TCFLAGS_HAVE_ELEM_EQUALITY 0x000400 |
#define | TCFLAGS_HAVE_ELEM_COMPARE 0x000800 |
#define | TCFLAGS_HAVE_ELEM_HASHING 0x001000 |
#define | TCFLAGS_HAVE_ELEM_EXTENDED_HASHING 0x002000 |
#define | TCFLAGS_CHECKED_FIELD_PROPERTIES 0x004000 |
#define | TCFLAGS_HAVE_FIELD_EQUALITY 0x008000 |
#define | TCFLAGS_HAVE_FIELD_COMPARE 0x010000 |
#define | TCFLAGS_HAVE_FIELD_HASHING 0x020000 |
#define | TCFLAGS_HAVE_FIELD_EXTENDED_HASHING 0x040000 |
#define | TCFLAGS_CHECKED_DOMAIN_CONSTRAINTS 0x080000 |
#define | TCFLAGS_DOMAIN_BASE_IS_COMPOSITE 0x100000 |
#define | TCFLAGS_OPERATOR_FLAGS |
Typedefs | |
typedef struct RelIdToTypeIdCacheEntry | RelIdToTypeIdCacheEntry |
typedef struct TypeCacheEnumData | TypeCacheEnumData |
typedef struct RecordCacheEntry | RecordCacheEntry |
typedef struct SharedRecordTableKey | SharedRecordTableKey |
typedef struct SharedRecordTableEntry | SharedRecordTableEntry |
typedef struct SharedTypmodTableEntry | SharedTypmodTableEntry |
typedef struct RecordCacheArrayEntry | RecordCacheArrayEntry |
Variables | |
static HTAB * | TypeCacheHash = NULL |
static HTAB * | RelIdToTypeIdCacheHash = NULL |
static TypeCacheEntry * | firstDomainTypeEntry = NULL |
static Oid * | in_progress_list |
static int | in_progress_list_len |
static int | in_progress_list_maxlen |
static const dshash_parameters | srtr_record_table_params |
static const dshash_parameters | srtr_typmod_table_params |
static HTAB * | RecordCacheHash = NULL |
static RecordCacheArrayEntry * | RecordCacheArray = NULL |
static int32 | RecordCacheArrayLen = 0 |
static int32 | NextRecordTypmod = 0 |
static uint64 | tupledesc_id_counter = INVALID_TUPLEDESC_IDENTIFIER |
#define TCFLAGS_CHECKED_BTREE_OPCLASS 0x000002 |
Definition at line 100 of file typcache.c.
#define TCFLAGS_CHECKED_CMP_PROC 0x000040 |
Definition at line 105 of file typcache.c.
#define TCFLAGS_CHECKED_DOMAIN_CONSTRAINTS 0x080000 |
Definition at line 118 of file typcache.c.
#define TCFLAGS_CHECKED_ELEM_PROPERTIES 0x000200 |
Definition at line 108 of file typcache.c.
#define TCFLAGS_CHECKED_EQ_OPR 0x000008 |
Definition at line 102 of file typcache.c.
#define TCFLAGS_CHECKED_FIELD_PROPERTIES 0x004000 |
Definition at line 113 of file typcache.c.
#define TCFLAGS_CHECKED_GT_OPR 0x000020 |
Definition at line 104 of file typcache.c.
#define TCFLAGS_CHECKED_HASH_EXTENDED_PROC 0x000100 |
Definition at line 107 of file typcache.c.
#define TCFLAGS_CHECKED_HASH_OPCLASS 0x000004 |
Definition at line 101 of file typcache.c.
#define TCFLAGS_CHECKED_HASH_PROC 0x000080 |
Definition at line 106 of file typcache.c.
#define TCFLAGS_CHECKED_LT_OPR 0x000010 |
Definition at line 103 of file typcache.c.
#define TCFLAGS_DOMAIN_BASE_IS_COMPOSITE 0x100000 |
Definition at line 119 of file typcache.c.
#define TCFLAGS_HAVE_ELEM_COMPARE 0x000800 |
Definition at line 110 of file typcache.c.
#define TCFLAGS_HAVE_ELEM_EQUALITY 0x000400 |
Definition at line 109 of file typcache.c.
#define TCFLAGS_HAVE_ELEM_EXTENDED_HASHING 0x002000 |
Definition at line 112 of file typcache.c.
#define TCFLAGS_HAVE_ELEM_HASHING 0x001000 |
Definition at line 111 of file typcache.c.
#define TCFLAGS_HAVE_FIELD_COMPARE 0x010000 |
Definition at line 115 of file typcache.c.
#define TCFLAGS_HAVE_FIELD_EQUALITY 0x008000 |
Definition at line 114 of file typcache.c.
#define TCFLAGS_HAVE_FIELD_EXTENDED_HASHING 0x040000 |
Definition at line 117 of file typcache.c.
#define TCFLAGS_HAVE_FIELD_HASHING 0x020000 |
Definition at line 116 of file typcache.c.
#define TCFLAGS_HAVE_PG_TYPE_DATA 0x000001 |
Definition at line 99 of file typcache.c.
#define TCFLAGS_OPERATOR_FLAGS |
Definition at line 122 of file typcache.c.
typedef struct RecordCacheArrayEntry RecordCacheArrayEntry |
typedef struct RecordCacheEntry RecordCacheEntry |
typedef struct RelIdToTypeIdCacheEntry RelIdToTypeIdCacheEntry |
typedef struct SharedRecordTableEntry SharedRecordTableEntry |
typedef struct SharedRecordTableKey SharedRecordTableKey |
typedef struct SharedTypmodTableEntry SharedTypmodTableEntry |
typedef struct TypeCacheEnumData TypeCacheEnumData |
|
static |
Definition at line 1522 of file typcache.c.
References cache_array_element_properties(), TypeCacheEntry::flags, TCFLAGS_CHECKED_ELEM_PROPERTIES, and TCFLAGS_HAVE_ELEM_COMPARE.
Referenced by lookup_type_cache().
|
static |
Definition at line 1514 of file typcache.c.
References cache_array_element_properties(), TypeCacheEntry::flags, TCFLAGS_CHECKED_ELEM_PROPERTIES, and TCFLAGS_HAVE_ELEM_EQUALITY.
Referenced by lookup_type_cache().
|
static |
Definition at line 1538 of file typcache.c.
References cache_array_element_properties(), TypeCacheEntry::flags, TCFLAGS_CHECKED_ELEM_PROPERTIES, and TCFLAGS_HAVE_ELEM_EXTENDED_HASHING.
Referenced by lookup_type_cache().
|
static |
Definition at line 1530 of file typcache.c.
References cache_array_element_properties(), TypeCacheEntry::flags, TCFLAGS_CHECKED_ELEM_PROPERTIES, and TCFLAGS_HAVE_ELEM_HASHING.
Referenced by lookup_type_cache().
Definition at line 2132 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 2040 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().
void AtEOSubXact_TypeCache | ( | void | ) |
Definition at line 3184 of file typcache.c.
References finalize_in_progress_typentries().
Referenced by AbortSubTransaction(), and CommitSubTransaction().
void AtEOXact_TypeCache | ( | void | ) |
Definition at line 3178 of file typcache.c.
References finalize_in_progress_typentries().
Referenced by AbortTransaction(), CommitTransaction(), and PrepareTransaction().
|
static |
Definition at line 1546 of file typcache.c.
References TypeCacheEntry::cmp_proc, TypeCacheEntry::eq_opr, TypeCacheEntry::flags, get_base_element_type(), TypeCacheEntry::hash_extended_proc, TypeCacheEntry::hash_proc, lookup_type_cache(), OidIsValid, TCFLAGS_CHECKED_ELEM_PROPERTIES, TCFLAGS_HAVE_ELEM_COMPARE, TCFLAGS_HAVE_ELEM_EQUALITY, TCFLAGS_HAVE_ELEM_EXTENDED_HASHING, TCFLAGS_HAVE_ELEM_HASHING, TypeCacheEntry::type_id, TYPECACHE_CMP_PROC, TYPECACHE_EQ_OPR, TYPECACHE_HASH_EXTENDED_PROC, and TYPECACHE_HASH_PROC.
Referenced by array_element_has_compare(), array_element_has_equality(), array_element_has_extended_hashing(), and array_element_has_hashing().
|
static |
Definition at line 1769 of file typcache.c.
References TypeCacheEntry::flags, TypeCacheEntry::hash_extended_proc, TypeCacheEntry::hash_proc, load_multirangetype_info(), lookup_type_cache(), OidIsValid, TypeCacheEntry::rngelemtype, TypeCacheEntry::rngtype, TCFLAGS_CHECKED_ELEM_PROPERTIES, TCFLAGS_HAVE_ELEM_EXTENDED_HASHING, TCFLAGS_HAVE_ELEM_HASHING, TypeCacheEntry::type_id, TYPECACHE_HASH_EXTENDED_PROC, TYPECACHE_HASH_PROC, and TypeCacheEntry::typtype.
Referenced by multirange_element_has_extended_hashing(), and multirange_element_has_hashing().
|
static |
Definition at line 1729 of file typcache.c.
References TypeCacheEntry::flags, TypeCacheEntry::hash_extended_proc, TypeCacheEntry::hash_proc, load_rangetype_info(), lookup_type_cache(), OidIsValid, TypeCacheEntry::rngelemtype, TCFLAGS_CHECKED_ELEM_PROPERTIES, TCFLAGS_HAVE_ELEM_EXTENDED_HASHING, TCFLAGS_HAVE_ELEM_HASHING, TypeCacheEntry::type_id, TYPECACHE_HASH_EXTENDED_PROC, TYPECACHE_HASH_PROC, and TypeCacheEntry::typtype.
Referenced by range_element_has_extended_hashing(), and range_element_has_hashing().
|
static |
Definition at line 1608 of file typcache.c.
References TypeCacheEntry::cmp_proc, DecrTupleDescRefCount(), TypeCacheEntry::domainBaseType, TypeCacheEntry::domainBaseTypmod, TypeCacheEntry::eq_opr, TypeCacheEntry::flags, getBaseTypeAndTypmod(), TypeCacheEntry::hash_extended_proc, TypeCacheEntry::hash_proc, i, IncrTupleDescRefCount(), InvalidOid, load_typcache_tupdesc(), lookup_type_cache(), TupleDescData::natts, OidIsValid, TCFLAGS_CHECKED_FIELD_PROPERTIES, TCFLAGS_DOMAIN_BASE_IS_COMPOSITE, TCFLAGS_HAVE_FIELD_COMPARE, TCFLAGS_HAVE_FIELD_EQUALITY, TCFLAGS_HAVE_FIELD_EXTENDED_HASHING, TCFLAGS_HAVE_FIELD_HASHING, TypeCacheEntry::tupDesc, TupleDescAttr, TypeCacheEntry::type_id, TYPECACHE_CMP_PROC, TYPECACHE_EQ_OPR, TYPECACHE_HASH_EXTENDED_PROC, TYPECACHE_HASH_PROC, and TypeCacheEntry::typtype.
Referenced by record_fields_have_compare(), record_fields_have_equality(), record_fields_have_extended_hashing(), and record_fields_have_hashing().
int compare_values_of_enum | ( | TypeCacheEntry * | tcache, |
Oid | arg1, | ||
Oid | arg2 | ||
) |
Definition at line 2650 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().
|
static |
Definition at line 1341 of file typcache.c.
References arg, DomainConstraintRef::constraints, DomainConstraintRef::dcc, decr_dcc_refcount(), and NIL.
Referenced by InitDomainConstraintRef().
|
static |
Definition at line 1317 of file typcache.c.
Referenced by load_domaintype_info().
|
static |
Definition at line 1330 of file typcache.c.
References Assert, DomainConstraintCache::dccContext, DomainConstraintCache::dccRefCount, and MemoryContextDelete().
Referenced by dccref_deletion_callback(), load_domaintype_info(), and UpdateDomainConstraintRef().
|
static |
Definition at line 3095 of file typcache.c.
References Assert, TypeCacheEntry::flags, HASH_FIND, HASH_REMOVE, hash_search(), i, in_progress_list, in_progress_list_len, OidIsValid, RelIdToTypeIdCacheHash, TCFLAGS_HAVE_PG_TYPE_DATA, TCFLAGS_OPERATOR_FLAGS, TypeCacheEntry::tupDesc, TypeCacheEntry::type_id, TypeCacheEntry::typrelid, and TypeCacheEntry::typtype.
Referenced by InvalidateCompositeTypeCacheEntry(), and TypeCacheTypCallback().
bool DomainHasConstraints | ( | Oid | type_id | ) |
Definition at line 1487 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().
|
static |
Definition at line 1797 of file typcache.c.
References CacheMemoryContext, MemoryContextAllocZero(), pg_nextpower2_32(), RecordCacheArray, RecordCacheArrayLen, and repalloc0_array.
Referenced by assign_record_type_typmod(), and lookup_rowtype_tupdesc_internal().
|
inlinestatic |
Definition at line 2621 of file typcache.c.
References arg, TypeCacheEnumData::bitmap_base, bms_is_member(), and TypeCacheEnumData::sorted_values.
Referenced by compare_values_of_enum().
|
static |
Definition at line 2895 of file typcache.c.
References EnumItem::enum_oid, and pg_cmp_u32().
Referenced by find_enumitem(), and load_enum_cache_data().
|
static |
Definition at line 3159 of file typcache.c.
References HASH_FIND, hash_search(), i, in_progress_list, in_progress_list_len, insert_rel_type_cache_if_needed(), and TypeCacheHash.
Referenced by AtEOSubXact_TypeCache(), and AtEOXact_TypeCache().
|
static |
Definition at line 2878 of file typcache.c.
References arg, EnumItem::enum_oid, enum_oid_cmp(), TypeCacheEnumData::enum_values, and TypeCacheEnumData::num_values.
Referenced by compare_values_of_enum().
Definition at line 2929 of file typcache.c.
References Session::area, Assert, CurrentSession, dsa_free(), dsa_get_address(), dshash_delete_key(), dshash_find(), dshash_find_or_insert(), dshash_release_lock(), elog, ERROR, SharedRecordTableEntry::key, sort-test::key, SharedRecordTypmodRegistry::next_typmod, pg_atomic_fetch_add_u32(), PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, share_tupledesc(), SharedRecordTableKey::shared, Session::shared_record_table, SharedRecordTableKey::shared_tupdesc, SharedTypmodTableEntry::shared_tupdesc, Session::shared_typmod_registry, Session::shared_typmod_table, TupleDescData::tdrefcount, SharedTypmodTableEntry::typmod, and SharedRecordTableKey::u.
Referenced by assign_record_type_typmod().
void InitDomainConstraintRef | ( | Oid | type_id, |
DomainConstraintRef * | ref, | ||
MemoryContext | refctx, | ||
bool | need_exprstate | ||
) |
Definition at line 1400 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().
|
static |
Definition at line 3061 of file typcache.c.
References Assert, RelIdToTypeIdCacheEntry::composite_typid, TypeCacheEntry::flags, HASH_ENTER, hash_search(), OidIsValid, RelIdToTypeIdCacheEntry::relid, RelIdToTypeIdCacheHash, TCFLAGS_HAVE_PG_TYPE_DATA, TCFLAGS_OPERATOR_FLAGS, TypeCacheEntry::tupDesc, TypeCacheEntry::type_id, TypeCacheEntry::typrelid, and TypeCacheEntry::typtype.
Referenced by finalize_in_progress_typentries(), and lookup_type_cache().
|
static |
Definition at line 2363 of file typcache.c.
References Assert, delete_rel_type_cache_if_needed(), TypeCacheEntry::flags, FreeTupleDesc(), OidIsValid, TCFLAGS_OPERATOR_FLAGS, TupleDescData::tdrefcount, TypeCacheEntry::tupDesc, TypeCacheEntry::tupDesc_identifier, TypeCacheEntry::typrelid, and TypeCacheEntry::typtype.
Referenced by TypeCacheRelCallback().
|
static |
Definition at line 1081 of file typcache.c.
References AccessShareLock, ALLOCSET_SMALL_SIZES, AllocSetContextCreate, BTEqualStrategyNumber, CacheMemoryContext, DomainConstraintState::check_expr, DomainConstraintState::check_exprstate, DomainConstraintCache::constraints, DomainConstraintState::constrainttype, CurrentMemoryContext, DomainConstraintCache::dccContext, DomainConstraintCache::dccRefCount, dcs_cmp(), decr_dcc_refcount(), DOM_CONSTRAINT_CHECK, DOM_CONSTRAINT_NOTNULL, TypeCacheEntry::domainData, elog, ERROR, expression_planner(), fastgetattr(), TypeCacheEntry::flags, GETSTRUCT, HeapTupleIsValid, sort-test::key, lcons(), makeNode, MemoryContextAlloc(), MemoryContextSetParent(), MemoryContextSwitchTo(), DomainConstraintState::name, NameStr, NIL, ObjectIdGetDatum(), palloc(), pstrdup(), qsort, RelationData::rd_att, ReleaseSysCache(), repalloc(), ScanKeyInit(), SearchSysCache1(), stringToNode(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), table_open(), TCFLAGS_CHECKED_DOMAIN_CONSTRAINTS, TextDatumGetCString, TypeCacheEntry::type_id, and val.
Referenced by lookup_type_cache(), and UpdateDomainConstraintRef().
|
static |
Definition at line 2723 of file typcache.c.
References AccessShareLock, TypeCacheEnumData::bitmap_base, bms_add_member(), bms_copy(), bms_free(), bms_make_singleton(), BTEqualStrategyNumber, CacheMemoryContext, enum_oid_cmp(), TypeCacheEnumData::enum_values, TypeCacheEntry::enumData, ereport, errcode(), errmsg(), ERROR, format_type_be(), GETSTRUCT, HeapTupleIsValid, i, InvalidOid, items, MemoryContextSwitchTo(), TypeCacheEnumData::num_values, ObjectIdGetDatum(), palloc(), pfree(), qsort, repalloc(), ScanKeyInit(), TypeCacheEnumData::sorted_values, systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), table_open(), TypeCacheEntry::type_id, and TypeCacheEntry::typtype.
Referenced by compare_values_of_enum().
|
static |
Definition at line 1059 of file typcache.c.
References elog, ERROR, get_multirange_range(), lookup_type_cache(), OidIsValid, TypeCacheEntry::rngtype, TypeCacheEntry::type_id, and TYPECACHE_RANGE_INFO.
Referenced by cache_multirange_element_properties(), and lookup_type_cache().
|
static |
Definition at line 1001 of file typcache.c.
References BTORDER_PROC, CacheMemoryContext, elog, ERROR, fmgr_info_cxt(), get_opclass_family(), get_opclass_input_type(), get_opfamily_proc(), GETSTRUCT, HeapTupleIsValid, lookup_type_cache(), ObjectIdGetDatum(), OidIsValid, RegProcedureIsValid, ReleaseSysCache(), TypeCacheEntry::rng_canonical_finfo, TypeCacheEntry::rng_cmp_proc_finfo, TypeCacheEntry::rng_collation, TypeCacheEntry::rng_opfamily, TypeCacheEntry::rng_subdiff_finfo, TypeCacheEntry::rngelemtype, SearchSysCache1(), and TypeCacheEntry::type_id.
Referenced by cache_range_element_properties(), and lookup_type_cache().
|
static |
Definition at line 967 of file typcache.c.
References AccessShareLock, Assert, elog, ERROR, OidIsValid, RelationData::rd_rel, relation_close(), relation_open(), RelationGetDescr, TupleDescData::tdrefcount, TypeCacheEntry::tupDesc, TypeCacheEntry::tupDesc_identifier, tupledesc_id_counter, TypeCacheEntry::type_id, and TypeCacheEntry::typrelid.
Referenced by cache_record_field_properties(), and lookup_type_cache().
Definition at line 1920 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 1954 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 1976 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 1826 of file typcache.c.
References Session::area, Assert, CurrentSession, dsa_get_address(), dshash_find(), dshash_release_lock(), ensure_record_cache_typmod_slot_exists(), ereport, errcode(), errmsg(), ERROR, format_type_be(), RecordCacheArrayEntry::id, lookup_type_cache(), RecordCacheArray, RecordCacheArrayLen, SharedTypmodTableEntry::shared_tupdesc, Session::shared_typmod_registry, Session::shared_typmod_table, TupleDescData::tdrefcount, TupleDescData::tdtypmod, RecordCacheArrayEntry::tupdesc, TypeCacheEntry::tupDesc, tupledesc_id_counter, and TYPECACHE_TUPDESC.
Referenced by lookup_rowtype_tupdesc(), lookup_rowtype_tupdesc_copy(), lookup_rowtype_tupdesc_domain(), and lookup_rowtype_tupdesc_noerror().
Definition at line 1937 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 386 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_BLOBS, 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, in_progress_list, in_progress_list_len, in_progress_list_maxlen, INJECTION_POINT, insert_rel_type_cache_if_needed(), InvalidOid, load_domaintype_info(), load_multirangetype_info(), load_rangetype_info(), load_typcache_tupdesc(), TypeCacheEntry::lt_opr, MemoryContextAlloc(), 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(), RelIdToTypeIdCacheHash, repalloc(), 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_reverse(), 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_exclusion_or_unique_constraint(), check_memoizable(), contain_leaked_vars_walker(), CreateStatistics(), dependency_degree(), domain_state_setup(), DomainHasConstraints(), enum_cmp_internal(), ExecInitExprRec(), find_simplified_clause(), foreign_expr_walker(), get_attr_stat_type(), get_cached_rowtype(), get_elem_stat_type(), 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().
|
static |
Definition at line 1761 of file typcache.c.
References cache_multirange_element_properties(), TypeCacheEntry::flags, TCFLAGS_CHECKED_ELEM_PROPERTIES, and TCFLAGS_HAVE_ELEM_EXTENDED_HASHING.
Referenced by lookup_type_cache().
|
static |
Definition at line 1753 of file typcache.c.
References cache_multirange_element_properties(), TypeCacheEntry::flags, TCFLAGS_CHECKED_ELEM_PROPERTIES, and TCFLAGS_HAVE_ELEM_HASHING.
Referenced by lookup_type_cache().
|
static |
Definition at line 1362 of file typcache.c.
References DomainConstraintState::check_expr, DomainConstraintState::check_exprstate, DomainConstraintState::constrainttype, ExecInitExpr(), lappend(), lfirst, makeNode, MemoryContextSwitchTo(), DomainConstraintState::name, and NIL.
Referenced by InitDomainConstraintRef(), and UpdateDomainConstraintRef().
|
static |
Definition at line 1721 of file typcache.c.
References cache_range_element_properties(), TypeCacheEntry::flags, TCFLAGS_CHECKED_ELEM_PROPERTIES, and TCFLAGS_HAVE_ELEM_EXTENDED_HASHING.
Referenced by lookup_type_cache().
|
static |
Definition at line 1713 of file typcache.c.
References cache_range_element_properties(), TypeCacheEntry::flags, TCFLAGS_CHECKED_ELEM_PROPERTIES, and TCFLAGS_HAVE_ELEM_HASHING.
Referenced by lookup_type_cache().
|
static |
Definition at line 1584 of file typcache.c.
References cache_record_field_properties(), TypeCacheEntry::flags, TCFLAGS_CHECKED_FIELD_PROPERTIES, and TCFLAGS_HAVE_FIELD_COMPARE.
Referenced by lookup_type_cache().
|
static |
Definition at line 1576 of file typcache.c.
References cache_record_field_properties(), TypeCacheEntry::flags, TCFLAGS_CHECKED_FIELD_PROPERTIES, and TCFLAGS_HAVE_FIELD_EQUALITY.
Referenced by lookup_type_cache().
|
static |
Definition at line 1600 of file typcache.c.
References cache_record_field_properties(), TypeCacheEntry::flags, TCFLAGS_CHECKED_FIELD_PROPERTIES, and TCFLAGS_HAVE_FIELD_EXTENDED_HASHING.
Referenced by lookup_type_cache().
|
static |
Definition at line 1592 of file typcache.c.
References cache_record_field_properties(), TypeCacheEntry::flags, TCFLAGS_CHECKED_FIELD_PROPERTIES, and TCFLAGS_HAVE_FIELD_HASHING.
Referenced by lookup_type_cache().
|
static |
Definition at line 2024 of file typcache.c.
References a, b, equalRowTypes(), and RecordCacheEntry::tupdesc.
Referenced by assign_record_type_typmod().
|
static |
Definition at line 2013 of file typcache.c.
References data, hashRowType(), and RecordCacheEntry::tupdesc.
Referenced by assign_record_type_typmod().
|
static |
Definition at line 2908 of file typcache.c.
References dsa_allocate, dsa_get_address(), TupleDescData::tdtypmod, TupleDescCopy(), and TupleDescSize.
Referenced by find_or_make_matching_shared_tupledesc(), and SharedRecordTypmodRegistryInit().
|
static |
Definition at line 234 of file typcache.c.
References a, arg, b, dsa_get_address(), equalRowTypes(), SharedRecordTableKey::local_tupdesc, SharedRecordTableKey::shared, SharedRecordTableKey::shared_tupdesc, and SharedRecordTableKey::u.
|
static |
Definition at line 260 of file typcache.c.
References a, arg, dsa_get_address(), hashRowType(), SharedRecordTableKey::local_tupdesc, SharedRecordTableKey::shared, SharedRecordTableKey::shared_tupdesc, and SharedRecordTableKey::u.
|
static |
Definition at line 3041 of file typcache.c.
References CurrentSession, dshash_detach(), Session::shared_record_table, Session::shared_typmod_registry, and Session::shared_typmod_table.
Referenced by SharedRecordTypmodRegistryAttach(), and SharedRecordTypmodRegistryInit().
void SharedRecordTypmodRegistryAttach | ( | SharedRecordTypmodRegistry * | registry | ) |
Definition at line 2294 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 2173 of file typcache.c.
Referenced by GetSessionDsmHandle().
void SharedRecordTypmodRegistryInit | ( | SharedRecordTypmodRegistry * | registry, |
dsm_segment * | segment, | ||
dsa_area * | area | ||
) |
Definition at line 2195 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().
Definition at line 359 of file typcache.c.
References Assert, GetSysCacheHashValue1, sort-test::key, and ObjectIdGetDatum().
Referenced by lookup_type_cache().
Definition at line 2597 of file typcache.c.
References firstDomainTypeEntry, TypeCacheEntry::flags, TypeCacheEntry::nextDomain, and TCFLAGS_CHECKED_DOMAIN_CONSTRAINTS.
Referenced by lookup_type_cache().
Definition at line 2568 of file typcache.c.
References TypeCacheEntry::flags, hash_seq_init(), hash_seq_search(), TCFLAGS_OPERATOR_FLAGS, and TypeCacheHash.
Referenced by lookup_type_cache().
Definition at line 2415 of file typcache.c.
References Assert, RelIdToTypeIdCacheEntry::composite_typid, firstDomainTypeEntry, TypeCacheEntry::flags, HASH_FIND, hash_search(), hash_seq_init(), hash_seq_search(), InvalidateCompositeTypeCacheEntry(), TypeCacheEntry::nextDomain, OidIsValid, RelIdToTypeIdCacheHash, TCFLAGS_DOMAIN_BASE_IS_COMPOSITE, TCFLAGS_OPERATOR_FLAGS, TypeCacheHash, TypeCacheEntry::typrelid, and TypeCacheEntry::typtype.
Referenced by lookup_type_cache().
Definition at line 2511 of file typcache.c.
References Assert, delete_rel_type_cache_if_needed(), TypeCacheEntry::flags, hash_seq_init(), hash_seq_init_with_hash_value(), hash_seq_search(), TCFLAGS_CHECKED_DOMAIN_CONSTRAINTS, TCFLAGS_HAVE_PG_TYPE_DATA, TypeCacheEntry::type_id_hash, and TypeCacheHash.
Referenced by lookup_type_cache().
void UpdateDomainConstraintRef | ( | DomainConstraintRef * | ref | ) |
Definition at line 1438 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().
|
static |
Definition at line 96 of file typcache.c.
Referenced by lookup_type_cache(), TypeCacheConstrCallback(), and TypeCacheRelCallback().
|
static |
Definition at line 226 of file typcache.c.
Referenced by delete_rel_type_cache_if_needed(), finalize_in_progress_typentries(), and lookup_type_cache().
|
static |
Definition at line 227 of file typcache.c.
Referenced by delete_rel_type_cache_if_needed(), finalize_in_progress_typentries(), and lookup_type_cache().
|
static |
Definition at line 228 of file typcache.c.
Referenced by lookup_type_cache().
|
static |
Definition at line 306 of file typcache.c.
Referenced by assign_record_type_typmod(), SharedRecordTypmodRegistryAttach(), and SharedRecordTypmodRegistryInit().
|
static |
Definition at line 304 of file typcache.c.
Referenced by assign_record_type_identifier(), assign_record_type_typmod(), ensure_record_cache_typmod_slot_exists(), lookup_rowtype_tupdesc_internal(), and SharedRecordTypmodRegistryInit().
|
static |
Definition at line 305 of file typcache.c.
Referenced by assign_record_type_identifier(), ensure_record_cache_typmod_slot_exists(), and lookup_rowtype_tupdesc_internal().
|
static |
Definition at line 295 of file typcache.c.
Referenced by assign_record_type_typmod().
|
static |
Definition at line 87 of file typcache.c.
Referenced by delete_rel_type_cache_if_needed(), insert_rel_type_cache_if_needed(), lookup_type_cache(), and TypeCacheRelCallback().
|
static |
Definition at line 275 of file typcache.c.
Referenced by SharedRecordTypmodRegistryAttach(), and SharedRecordTypmodRegistryInit().
|
static |
Definition at line 285 of file typcache.c.
Referenced by SharedRecordTypmodRegistryAttach(), and SharedRecordTypmodRegistryInit().
|
static |
Definition at line 313 of file typcache.c.
Referenced by assign_record_type_identifier(), assign_record_type_typmod(), load_typcache_tupdesc(), and lookup_rowtype_tupdesc_internal().
|
static |
Definition at line 79 of file typcache.c.
Referenced by finalize_in_progress_typentries(), lookup_type_cache(), TypeCacheOpcCallback(), TypeCacheRelCallback(), and TypeCacheTypCallback().