typedefstruct RelationData
{
RelFileLocator rd_locator; /* relation physical identifier */
SMgrRelation rd_smgr; /* cached file handle, or NULL */ int rd_refcnt; /* reference count */
ProcNumber rd_backend; /* owning backend's proc number, if temp rel */ bool rd_islocaltemp; /* rel is a temp rel of this session */ bool rd_isnailed; /* rel is nailed in cache */ bool rd_isvalid; /* relcache entry is valid */ bool rd_indexvalid; /* is rd_indexlist valid? (also rd_pkindex and
* rd_replidindex) */ bool rd_statvalid; /* is rd_statlist valid? */
/*---------- *rd_createSubidistheIDofthehighestsubtransactiontherelhas *survivedintoorzeroifthereloritsstoragewascreatedbeforethe *currenttoptransaction.(IndexStmt.oldNumberleadstothecaseofanew *relwithanoldrd_locator.)rd_firstRelfilelocatorSubidistheIDofthe *highestsubtransactionanrd_locatorchangehassurvivedintoorzeroif *rd_locatormatchesthevalueithadatthestartofthecurrenttop *transaction.(Rollingbackthesubtransactionthat *rd_firstRelfilelocatorSubiddenoteswouldrestorerd_locatortothevalueit *hadatthestartofthecurrenttoptransaction.Rollingbackany *lowersubtransactionwouldnot.)Theiraccuracyiscriticalto *RelationNeedsWAL(). * *rd_newRelfilelocatorSubidistheIDofthehighestsubtransactionthe *most-recentrelfilenumberchangehassurvivedintoorzeroifnotchanged *inthecurrenttransaction(orwehaveforgottenchangingit).This *fieldisaccuratewhennon-zero,butitcanbezerowhenarelationhas *multiplenewrelfilenumberswithinasingletransaction,withoneofthem *occurringinasubsequentlyabortedsubtransaction,e.g. *BEGIN; *TRUNCATEt; *SAVEPOINTsave; *TRUNCATEt; *ROLLBACKTOsave; *--rd_newRelfilelocatorSubidisnowforgotten * *Ifeveryrd_*Subidfieldiszero,theyareread-onlyoutside *relcache.c.Filesthattriggerrd_locatorchangesbyupdating *pg_class.reltablespaceand/orpg_class.relfilenodecall *RelationAssumeNewRelfilelocator()toupdaterd_*Subid. * *rd_droppedSubidistheIDofthehighestsubtransactionthatadropof *therelhassurvivedinto.Inentriesvisibleoutsiderelcache.c,this *isalwayszero.
*/
SubTransactionId rd_createSubid; /* rel was created in current xact */
SubTransactionId rd_newRelfilelocatorSubid; /* highest subxact changing
* rd_locator to current value */
SubTransactionId rd_firstRelfilelocatorSubid; /* highest subxact *changingrd_locatorto
* any value */
SubTransactionId rd_droppedSubid; /* dropped with another Subid set */
Form_pg_class rd_rel; /* RELATION tuple */
TupleDesc rd_att; /* tuple descriptor */
Oid rd_id; /* relation's object id */
LockInfoData rd_lockInfo; /* lock mgr's info for locking relation */
RuleLock *rd_rules; /* rewrite rules */
MemoryContext rd_rulescxt; /* private memory cxt for rd_rules, if any */
TriggerDesc *trigdesc; /* Trigger info, or NULL if rel has none */ /* use "struct" here to avoid needing to include rowsecurity.h: */ struct RowSecurityDesc *rd_rsdesc; /* row security policies, or NULL */
/* data managed by RelationGetFKeyList: */
List *rd_fkeylist; /* list of ForeignKeyCacheInfo (see below) */ bool rd_fkeyvalid; /* true if list has been computed */
/* data managed by RelationGetPartitionKey: */
PartitionKey rd_partkey; /* partition key, or NULL */
MemoryContext rd_partkeycxt; /* private context for rd_partkey, if any */
/* data managed by RelationGetPartitionDesc: */
PartitionDesc rd_partdesc; /* partition descriptor, or NULL */
MemoryContext rd_pdcxt; /* private context for rd_partdesc, if any */
/* Same as above, for partdescs that omit detached partitions */
PartitionDesc rd_partdesc_nodetached; /* partdesc w/o detached parts */
MemoryContext rd_pddcxt; /* for rd_partdesc_nodetached, if any */
/* data managed by RelationGetPartitionQual: */
List *rd_partcheck; /* partition CHECK quals */ bool rd_partcheckvalid; /* true if list has been computed */
MemoryContext rd_partcheckcxt; /* private cxt for rd_partcheck, if any */
/* data managed by RelationGetIndexList: */
List *rd_indexlist; /* list of OIDs of indexes on relation */
Oid rd_pkindex; /* OID of (deferrable?) primary key, if any */ bool rd_ispkdeferrable; /* is rd_pkindex a deferrable PK? */
Oid rd_replidindex; /* OID of replica identity index, if any */
/* data managed by RelationGetStatExtList: */
List *rd_statlist; /* list of OIDs of extended stats */
/* data managed by RelationGetIndexAttrBitmap: */ bool rd_attrsvalid; /* are bitmaps of attrs valid? */
Bitmapset *rd_keyattr; /* cols that can be ref'd by foreign keys */
Bitmapset *rd_pkattr; /* cols included in primary key */
Bitmapset *rd_idattr; /* included in replica identity index */
Bitmapset *rd_hotblockingattr; /* cols blocking HOT update */
Bitmapset *rd_summarizedattr; /* cols indexed by summarizing indexes */
PublicationDesc *rd_pubdesc; /* publication descriptor, or NULL */
/* *Oidofthehandlerforthisrelation.Foranindexthisisafunction *returningIndexAmRoutine,fortablelikerelationsafunctionreturning *TableAmRoutine.Thisisstoredseparatelyfromrd_indam,rd_tableamas *itslookuprequiressyscacheaccess,butduringrelcachebootstrapwe *needtobeabletoinitializerd_tableamwithoutsyscachelookups.
*/
Oid rd_amhandler; /* OID of index AM's handler function */
/* These are non-NULL only for an index relation: */
Form_pg_index rd_index; /* pg_index tuple describing this index */ /* use "struct" here to avoid needing to include htup.h: */ struct HeapTupleData *rd_indextuple; /* all of pg_index tuple */
/* *indexaccesssupportinfo(usedonlyforanindexrelation) * *Note:onlydefaultsupportprocsforeachopclassarecached,namely *thosewithlefttypeandrighttypeequaltotheopclass'sopcintype.The *arraysareindexedbysupportfunctionnumber,whichisasufficient *identifiergiventhatrestriction.
*/
MemoryContext rd_indexcxt; /* private memory cxt for this stuff */ /* use "struct" here to avoid needing to include amapi.h: */ struct IndexAmRoutine *rd_indam; /* index AM's API struct */
Oid *rd_opfamily; /* OIDs of op families for each index col */
Oid *rd_opcintype; /* OIDs of opclass declared input data types */
RegProcedure *rd_support; /* OIDs of support procedures */ struct FmgrInfo *rd_supportinfo; /* lookup info for support procedures */
int16 *rd_indoption; /* per-column AM-specific flags */
List *rd_indexprs; /* index expression trees, if any */
List *rd_indpred; /* index predicate tree, if any */
Oid *rd_exclops; /* OIDs of exclusion operators, if any */
Oid *rd_exclprocs; /* OIDs of exclusion ops' procs, if any */
uint16 *rd_exclstrats; /* exclusion ops' strategy numbers, if any */
Oid *rd_indcollation; /* OIDs of index collations */
bytea **rd_opcoptions; /* parsed opclass-specific options */
/* *rd_amcacheisavailableforindexandtableAMstocacheprivatedata *abouttherelation.Thismustbejustacachesinceitmaygetreset *atanytime(inparticular,itwillgetresetbyarelcacheinval *messagefortherelation).Ifused,itmustpointtoasinglememory *chunkpalloc'dinCacheMemoryContext,orinrd_indexcxtforanindex *relation.Arelcacheresetwillincludefreeingthatchunkandsetting *rd_amcache=NULL.
*/ void *rd_amcache; /* available for use by index/table AM */
/* use "struct" here to avoid needing to include fdwapi.h: */ struct FdwRoutine *rd_fdwroutine; /* cached function pointers, or NULL */
/* *HackforCLUSTER,rewritingALTERTABLE,etc:whenwritinganew *versionofatable,weneedtomakeanytoastpointersinsertedintoit *havetheexistingtoasttable'sOID,nottheOIDofthetransienttoast *table.Ifrd_toastoidisn'tInvalidOid,itistheOIDtoplacein *toastpointersinsertedintothisrel.(Noteit'ssetonthenew *versionofthemainheap,notthetoasttableitself.)Thisalso *causestoast_save_datum()totrytopreservetoastvalueOIDs.
*/
Oid rd_toastoid; /* Real TOAST table's OID, or InvalidOid */
bool pgstat_enabled; /* should relation stats be counted */ /* use "struct" here to avoid needing to include pgstat.h: */ struct PgStat_TableStatus *pgstat_info; /* statistics collection area */
} RelationData;
NodeTag type; /* oid of the constraint itself */
Oid conoid; /* relation constrained by the foreign key */
Oid conrelid; /* relation referenced by the foreign key */
Oid confrelid; /* number of columns in the foreign key */ int nkeys;
/* Is enforced ? */ bool conenforced;
/* *thesearrayseachhavenkeysvalidentries:
*/ /* cols in referencing table */
AttrNumber conkey[INDEX_MAX_KEYS] pg_node_attr(array_size(nkeys)); /* cols in referenced table */
AttrNumber confkey[INDEX_MAX_KEYS] pg_node_attr(array_size(nkeys)); /* PK = FK operator OIDs */
Oid conpfeqop[INDEX_MAX_KEYS] pg_node_attr(array_size(nkeys));
} ForeignKeyCacheInfo;
/* *StdRdOptions *Standardcontentsofrd_optionsforheaps. * *RelationGetFillFactor()andRelationGetTargetPageFreeSpace()canonly *beappliedtorelationsthatusethisformatorasupersetfor *privateoptionsdata.
*/ /* autovacuum-related reloptions. */ typedefstruct AutoVacOpts
{ bool enabled; int vacuum_threshold; int vacuum_max_threshold; int vacuum_ins_threshold; int analyze_threshold; int vacuum_cost_limit; int freeze_min_age; int freeze_max_age; int freeze_table_age; int multixact_freeze_min_age; int multixact_freeze_max_age; int multixact_freeze_table_age; int log_min_duration;
float8 vacuum_cost_delay;
float8 vacuum_scale_factor;
float8 vacuum_ins_scale_factor;
float8 analyze_scale_factor;
} AutoVacOpts;
typedefstruct StdRdOptions
{
int32 vl_len_; /* varlena header (do not touch directly!) */ int fillfactor; /* page fill factor in percent (0..100) */ int toast_tuple_target; /* target for tuple toasting */
AutoVacOpts autovacuum; /* autovacuum-related options */ bool user_catalog_table; /* use as an additional catalog relation */ int parallel_workers; /* max number of parallel workers */
StdRdOptIndexCleanup vacuum_index_cleanup; /* controls index vacuuming */ bool vacuum_truncate; /* enables vacuum to truncate a relation */ bool vacuum_truncate_set; /* whether vacuum_truncate is set */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.