PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "access/toast_compression.h"
#include "access/tupdesc_details.h"
#include "catalog/pg_collation.h"
#include "catalog/pg_type.h"
#include "common/hashfn.h"
#include "utils/builtins.h"
#include "utils/datum.h"
#include "utils/resowner.h"
#include "utils/syscache.h"
Go to the source code of this file.
Variables | |
static const ResourceOwnerDesc | tupdesc_resowner_desc |
TupleDesc BuildDescFromLists | ( | const List * | names, |
const List * | types, | ||
const List * | typmods, | ||
const List * | collations | ||
) |
Definition at line 858 of file tupdesc.c.
References Assert, attname, attnum, CreateTemplateTupleDesc(), forfour, lfirst, lfirst_int, lfirst_oid, list_length(), strVal, TupleDescInitEntry(), TupleDescInitEntryCollation(), and types.
Referenced by ExecInitFunctionScan(), ExecInitTableFuncScan(), and inline_set_returning_function().
TupleDesc CreateTemplateTupleDesc | ( | int | natts | ) |
Definition at line 67 of file tupdesc.c.
References Assert, TupleDescData::constr, FormData_pg_attribute, TupleDescData::natts, palloc(), TupleDescData::tdrefcount, TupleDescData::tdtypeid, and TupleDescData::tdtypmod.
Referenced by aclexplode(), addRangeTableEntryForFunction(), AllocateRelationDesc(), brtuple_disk_tupdesc(), build_function_result_tupdesc_d(), build_row_from_vars(), BuildDescForRelation(), BuildDescFromLists(), BuildHardcodedDescriptor(), ConstructTupleDescriptor(), create_toast_table(), CreateReplicationSlot(), CreateTupleDesc(), CreateTupleDescCopy(), CreateTupleDescCopyConstr(), dblink_get_pkey(), ExecInitFunctionScan(), ExecMakeTableFunctionResult(), ExecTypeFromExprList(), ExecTypeFromTLInternal(), expandRecordVariable(), ExplainResultDesc(), formrdesc(), get_expr_result_type(), GetPGVariableResultDesc(), gistrescan(), IdentifySystem(), init_sexpr(), initGinState(), injection_points_stats_fixed(), libpqrcv_processTuples(), load_relcache_init_file(), materializeResult(), ordered_set_startup(), pg_buffercache_pages(), pg_get_publication_tables(), pg_get_sequence_data(), pg_lock_status(), pg_prepared_xact(), pg_stat_file(), pg_stat_get_archiver(), pg_stat_get_backend_subxact(), pg_stat_get_replication_slot(), pg_stat_get_subscription_stats(), pg_stat_get_wal(), pg_visibility_tupdesc(), pg_walfile_name_offset(), ReadReplicationSlot(), SendTablespaceList(), SendTimeLineHistory(), SendXlogRecPtrResult(), show_all_settings(), ShowAllGUCConfig(), ShowGUCConfigOption(), StartReplication(), test_predtest(), tsvector_unnest(), and TypeGetTupleDesc().
TupleDesc CreateTupleDesc | ( | int | natts, |
Form_pg_attribute * | attrs | ||
) |
Definition at line 112 of file tupdesc.c.
References ATTRIBUTE_FIXED_PART_SIZE, CreateTemplateTupleDesc(), i, and TupleDescAttr.
Referenced by AddNewAttributeTuples(), and InsertOneTuple().
Definition at line 133 of file tupdesc.c.
References CreateTemplateTupleDesc(), FormData_pg_attribute, i, TupleDescData::natts, TupleDescData::tdtypeid, TupleDescData::tdtypmod, and TupleDescAttr.
Referenced by assign_record_type_typmod(), BuildTupleHashTableExt(), connectby_text(), connectby_text_serial(), CopyCachedPlan(), crosstab(), crosstab_hash(), database_to_xmlschema_internal(), do_autovacuum(), ExecEvalWholeRowVar(), ExecInitForeignScan(), ExecInitFunctionScan(), ExecInsert(), ExecPrepareTuplestoreResult(), FetchPreparedStatementResultDesc(), fmgr_sql(), get_record_type_from_query(), get_tupdesc_for_join_scan_tuples(), GetAfterTriggersStoreSlot(), getSpGistTupleDesc(), gist_page_items(), init_sexpr(), InitMaterializedSRF(), make_expanded_record_from_exprecord(), make_expanded_record_from_tupdesc(), materializeResult(), PersistHoldablePortal(), plperl_return_next_internal(), plpgsql_exec_function(), pltcl_func_handler(), PLy_spi_execute_fetch_result(), populate_recordset_worker(), RelationBuildLocalRelation(), RelationNameGetTupleDesc(), RevalidateCachedQuery(), schema_to_xmlschema_internal(), spi_dest_startup(), storeRow(), update_cached_tupdesc(), and UtilityTupleDescriptor().
Definition at line 173 of file tupdesc.c.
References AttrDefault::adbin, AttrMissing::am_present, AttrMissing::am_value, ConstrCheck::ccbin, ConstrCheck::ccname, ConstrCheck::ccnoinherit, ConstrCheck::ccvalid, TupleConstr::check, TupleDescData::constr, CreateTemplateTupleDesc(), datumCopy(), TupleConstr::defval, FormData_pg_attribute, TupleConstr::has_generated_stored, TupleConstr::has_not_null, i, TupleConstr::missing, TupleDescData::natts, TupleConstr::num_check, TupleConstr::num_defval, palloc(), palloc0(), pstrdup(), TupleDescData::tdtypeid, TupleDescData::tdtypmod, and TupleDescAttr.
Referenced by ATGetQueueEntry(), CatalogCacheInitializeCache(), init_tuple_slot(), initGISTstate(), and lookup_rowtype_tupdesc_copy().
void DecrTupleDescRefCount | ( | TupleDesc | tupdesc | ) |
Definition at line 406 of file tupdesc.c.
References Assert, CurrentResourceOwner, FreeTupleDesc(), ResourceOwnerForgetTupleDesc(), and TupleDescData::tdrefcount.
Referenced by cache_record_field_properties(), and ExecEvalConvertRowtype().
Definition at line 586 of file tupdesc.c.
References i, NameStr, TupleDescData::natts, TupleDescData::tdtypeid, and TupleDescAttr.
Referenced by acquire_inherited_sample_rows(), ProcedureCreate(), record_type_typmod_compare(), RevalidateCachedQuery(), and shared_record_table_compare().
Definition at line 419 of file tupdesc.c.
References AttrDefault::adbin, AttrDefault::adnum, AttrMissing::am_present, AttrMissing::am_value, ConstrCheck::ccbin, ConstrCheck::ccname, ConstrCheck::ccnoinherit, ConstrCheck::ccvalid, TupleConstr::check, TupleDescData::constr, datumIsEqual(), TupleConstr::defval, TupleConstr::has_generated_stored, TupleConstr::has_not_null, i, TupleConstr::missing, NameStr, TupleDescData::natts, TupleConstr::num_check, TupleConstr::num_defval, TupleDescData::tdtypeid, and TupleDescAttr.
Referenced by RelationClearRelation(), and RelationFindReplTupleSeq().
void FreeTupleDesc | ( | TupleDesc | tupdesc | ) |
Definition at line 331 of file tupdesc.c.
References Assert, attbyval, TupleConstr::check, TupleDescData::constr, DatumGetPointer(), TupleConstr::defval, i, TupleConstr::missing, TupleDescData::natts, TupleConstr::num_check, TupleConstr::num_defval, pfree(), TupleDescData::tdrefcount, and TupleDescAttr.
Referenced by AddNewAttributeTuples(), AtEOXact_RelationCache(), DecrTupleDescRefCount(), ER_mc_callback(), ExecMakeTableFunctionResult(), ExecPrepareTuplestoreResult(), get_record_type_from_query(), ordered_set_startup(), PLy_result_dealloc(), RelationDestroyRelation(), ResOwnerReleaseTupleDesc(), RevalidateCachedQuery(), spgendscan(), TypeCacheRelCallback(), update_cached_tupdesc(), and walrcv_clear_result().
Definition at line 622 of file tupdesc.c.
References hash_combine(), hash_uint32(), i, TupleDescData::natts, TupleDescData::tdtypeid, and TupleDescAttr.
Referenced by record_type_typmod_hash(), and shared_record_table_hash().
void IncrTupleDescRefCount | ( | TupleDesc | tupdesc | ) |
Definition at line 388 of file tupdesc.c.
References Assert, CurrentResourceOwner, ResourceOwnerEnlarge(), ResourceOwnerRememberTupleDesc(), and TupleDescData::tdrefcount.
Referenced by cache_record_field_properties(), and ExecEvalConvertRowtype().
|
inlinestatic |
Definition at line 54 of file tupdesc.c.
References PointerGetDatum(), ResourceOwnerForget(), and tupdesc_resowner_desc.
Referenced by DecrTupleDescRefCount().
|
inlinestatic |
Definition at line 48 of file tupdesc.c.
References PointerGetDatum(), ResourceOwnerRemember(), and tupdesc_resowner_desc.
Referenced by IncrTupleDescRefCount().
|
static |
Definition at line 934 of file tupdesc.c.
References DatumGetPointer(), psprintf(), res, TupleDescData::tdtypeid, and TupleDescData::tdtypmod.
|
static |
Definition at line 923 of file tupdesc.c.
References Assert, DatumGetPointer(), FreeTupleDesc(), res, and TupleDescData::tdrefcount.
Definition at line 251 of file tupdesc.c.
References TupleDescData::constr, i, TupleDescData::natts, TupleDescData::tdrefcount, TupleDescAttr, and TupleDescSize.
Referenced by index_truncate_tuple(), and share_tupledesc().
void TupleDescCopyEntry | ( | TupleDesc | dst, |
AttrNumber | dstAttno, | ||
TupleDesc | src, | ||
AttrNumber | srcAttno | ||
) |
Definition at line 289 of file tupdesc.c.
References Assert, ATTRIBUTE_FIXED_PART_SIZE, PointerIsValid, and TupleDescAttr.
Referenced by addRangeTableEntryForFunction(), ExecInitFunctionScan(), and ordered_set_startup().
Node* TupleDescGetDefault | ( | TupleDesc | tupdesc, |
AttrNumber | attnum | ||
) |
Definition at line 899 of file tupdesc.c.
References attnum, TupleDescData::constr, TupleConstr::defval, i, TupleConstr::num_defval, and stringToNode().
Referenced by build_column_default(), expandTableLikeClause(), and MergeAttributes().
void TupleDescInitBuiltinEntry | ( | TupleDesc | desc, |
AttrNumber | attributeNumber, | ||
const char * | attributeName, | ||
Oid | oidtypeid, | ||
int32 | typmod, | ||
int | attdim | ||
) |
Definition at line 726 of file tupdesc.c.
References Assert, elog, ERROR, FLOAT8PASSBYVAL, InvalidCompressionMethod, InvalidOid, namestrcpy(), PG_INT16_MAX, PointerIsValid, and TupleDescAttr.
Referenced by CreateReplicationSlot(), IdentifySystem(), ReadReplicationSlot(), SendTablespaceList(), SendTimeLineHistory(), SendXlogRecPtrResult(), ShowAllGUCConfig(), ShowGUCConfigOption(), and StartReplication().
void TupleDescInitEntry | ( | TupleDesc | desc, |
AttrNumber | attributeNumber, | ||
const char * | attributeName, | ||
Oid | oidtypeid, | ||
int32 | typmod, | ||
int | attdim | ||
) |
Definition at line 651 of file tupdesc.c.
References Assert, elog, ERROR, GETSTRUCT, HeapTupleIsValid, InvalidCompressionMethod, MemSet, NAMEDATALEN, NameStr, namestrcpy(), ObjectIdGetDatum(), PG_INT16_MAX, PointerIsValid, ReleaseSysCache(), SearchSysCache1(), and TupleDescAttr.
Referenced by aclexplode(), addRangeTableEntryForFunction(), brtuple_disk_tupdesc(), build_function_result_tupdesc_d(), build_row_from_vars(), BuildDescForRelation(), BuildDescFromLists(), CallStmtResultDesc(), create_toast_table(), dblink_get_pkey(), ExecInitFunctionScan(), ExecMakeTableFunctionResult(), ExecTypeFromExprList(), ExecTypeFromTLInternal(), expandRecordVariable(), ExplainResultDesc(), get_expr_result_type(), GetPGVariableResultDesc(), gistrescan(), init_sexpr(), initGinState(), injection_points_stats_fixed(), libpqrcv_processTuples(), materializeResult(), ordered_set_startup(), pg_buffercache_pages(), pg_get_publication_tables(), pg_get_sequence_data(), pg_lock_status(), pg_prepared_xact(), pg_stat_file(), pg_stat_get_archiver(), pg_stat_get_backend_subxact(), pg_stat_get_replication_slot(), pg_stat_get_subscription_stats(), pg_stat_get_wal(), pg_visibility_tupdesc(), pg_walfile_name_offset(), resolve_polymorphic_tupdesc(), show_all_settings(), test_predtest(), tsvector_unnest(), and TypeGetTupleDesc().
void TupleDescInitEntryCollation | ( | TupleDesc | desc, |
AttrNumber | attributeNumber, | ||
Oid | collationid | ||
) |
Definition at line 833 of file tupdesc.c.
References Assert, PointerIsValid, and TupleDescAttr.
Referenced by addRangeTableEntryForFunction(), build_row_from_vars(), BuildDescForRelation(), BuildDescFromLists(), ExecInitFunctionScan(), ExecTypeFromExprList(), ExecTypeFromTLInternal(), expandRecordVariable(), get_expr_result_type(), initGinState(), and resolve_polymorphic_tupdesc().
|
static |
Definition at line 37 of file tupdesc.c.
Referenced by ResourceOwnerForgetTupleDesc(), and ResourceOwnerRememberTupleDesc().