#include "access/tupdesc.h"
#include "catalog/pg_am.h"
#include "catalog/pg_class.h"
#include "catalog/pg_index.h"
#include "fmgr.h"
#include "nodes/bitmapset.h"
#include "rewrite/prs2lock.h"
#include "storage/block.h"
#include "storage/relfilenode.h"
#include "utils/relcache.h"
#include "utils/reltrigger.h"
Go to the source code of this file.
Data Structures | |
struct | LockRelId |
struct | LockInfoData |
struct | RelationAmInfo |
struct | RelationData |
struct | AutoVacOpts |
struct | StdRdOptions |
Defines | |
#define | HEAP_MIN_FILLFACTOR 10 |
#define | HEAP_DEFAULT_FILLFACTOR 100 |
#define | RelationGetFillFactor(relation, defaultff) |
#define | RelationGetTargetPageUsage(relation, defaultff) (BLCKSZ * RelationGetFillFactor(relation, defaultff) / 100) |
#define | RelationGetTargetPageFreeSpace(relation, defaultff) (BLCKSZ * (100 - RelationGetFillFactor(relation, defaultff)) / 100) |
#define | RelationIsSecurityView(relation) |
#define | RelationIsValid(relation) PointerIsValid(relation) |
#define | InvalidRelation ((Relation) NULL) |
#define | RelationHasReferenceCountZero(relation) ((bool)((relation)->rd_refcnt == 0)) |
#define | RelationGetForm(relation) ((relation)->rd_rel) |
#define | RelationGetRelid(relation) ((relation)->rd_id) |
#define | RelationGetNumberOfAttributes(relation) ((relation)->rd_rel->relnatts) |
#define | RelationGetDescr(relation) ((relation)->rd_att) |
#define | RelationGetRelationName(relation) (NameStr((relation)->rd_rel->relname)) |
#define | RelationGetNamespace(relation) ((relation)->rd_rel->relnamespace) |
#define | RelationIsMapped(relation) ((relation)->rd_rel->relfilenode == InvalidOid) |
#define | RelationOpenSmgr(relation) |
#define | RelationCloseSmgr(relation) |
#define | RelationGetTargetBlock(relation) ( (relation)->rd_smgr != NULL ? (relation)->rd_smgr->smgr_targblock : InvalidBlockNumber ) |
#define | RelationSetTargetBlock(relation, targblock) |
#define | RelationNeedsWAL(relation) ((relation)->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT) |
#define | RelationUsesLocalBuffers(relation) ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) |
#define | RELATION_IS_LOCAL(relation) |
#define | RELATION_IS_OTHER_TEMP(relation) |
#define | RelationIsScannable(relation) ((relation)->rd_ispopulated) |
Typedefs | |
typedef struct LockRelId | LockRelId |
typedef struct LockInfoData | LockInfoData |
typedef LockInfoData * | LockInfo |
typedef struct RelationAmInfo | RelationAmInfo |
typedef struct RelationData | RelationData |
typedef struct AutoVacOpts | AutoVacOpts |
typedef struct StdRdOptions | StdRdOptions |
Functions | |
void | RelationIncrementReferenceCount (Relation rel) |
void | RelationDecrementReferenceCount (Relation rel) |
#define HEAP_DEFAULT_FILLFACTOR 100 |
Definition at line 220 of file rel.h.
Referenced by heap_multi_insert(), heap_page_prune_opt(), raw_heap_insert(), and RelationGetBufferForTuple().
#define RELATION_IS_LOCAL | ( | relation | ) |
((relation)->rd_islocaltemp || \ (relation)->rd_createSubid != InvalidSubTransactionId)
Definition at line 390 of file rel.h.
Referenced by _bt_getbuf(), btvacuumscan(), GinNewBuffer(), ginvacuumcleanup(), gistNewBuffer(), gistvacuumcleanup(), RelationGetBufferForTuple(), SpGistNewBuffer(), and spgvacuumscan().
#define RELATION_IS_OTHER_TEMP | ( | relation | ) |
((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP && \ !(relation)->rd_islocaltemp)
Definition at line 400 of file rel.h.
Referenced by acquire_inherited_sample_rows(), analyze_rel(), ATExecSetTableSpace(), ATRewriteTables(), bt_metap(), bt_page_items(), bt_page_stats(), cluster(), cluster_rel(), DefineIndex(), expand_inherited_rtentry(), get_raw_page_internal(), pgstat_relation(), pgstatginindex(), pgstatindex(), PrefetchBuffer(), ReadBufferExtended(), reindex_index(), truncate_check_rel(), and vacuum_rel().
#define RelationCloseSmgr | ( | relation | ) |
do { \ if ((relation)->rd_smgr != NULL) \ { \ smgrclose((relation)->rd_smgr); \ Assert((relation)->rd_smgr == NULL); \ } \ } while (0)
Definition at line 339 of file rel.h.
Referenced by RelationCacheInvalidate(), RelationClearRelation(), RelationCloseSmgrByOid(), RelationDestroyRelation(), and RelationDropStorage().
#define RelationGetDescr | ( | relation | ) | ((relation)->rd_att) |
Definition at line 295 of file rel.h.
Referenced by _bt_check_unique(), _bt_checkkeys(), _bt_compare(), _bt_load(), _bt_mkscankey(), _hash_checkqual(), _hash_form_tuple(), acquire_inherited_sample_rows(), AddEnumLabel(), AddRelationNewConstraints(), AddRoleMems(), AlterDatabase(), AlterDatabaseOwner(), AlterDomainDefault(), AlterDomainNotNull(), AlterForeignDataWrapper(), AlterForeignServer(), AlterFunction(), AlterObjectNamespace_internal(), AlterObjectOwner_internal(), AlterObjectRename_internal(), AlterRole(), AlterSchemaOwner_internal(), AlterSetting(), AlterTableSpaceOptions(), AlterTSDictionary(), AlterUserMapping(), AppendAttributeTuples(), ApplyExtensionUpdates(), ApplySetting(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecChangeOwner(), ATExecGenericOptions(), ATExecSetOptions(), ATExecSetRelOptions(), ATGetQueueEntry(), ATRewriteTable(), BeginCopy(), BeginCopyFrom(), btbeginscan(), btbuildCallback(), btinsert(), build_row_from_class(), BuildEventTriggerCache(), CatalogCacheInitializeCache(), CatalogIndexInsert(), change_owner_fix_column_acls(), check_exclusion_constraint(), check_functional_grouping(), check_selective_binary_conversion(), CheckAttributeType(), CollationCreate(), comparetup_index_btree(), compute_index_stats(), ConstructTupleDescriptor(), conversion_error_callback(), copy_heap_data(), CopyFrom(), copyTemplateDependencies(), CopyTo(), copytup_index(), create_proc_lang(), CreateCast(), CreateComments(), CreateConstraintEntry(), createdb(), CreateRole(), CreateSharedComments(), currtid_for_view(), DefineQueryRewrite(), DefineSequence(), DelRoleMems(), deparseAnalyzeSql(), deparseTargetList(), do_autovacuum(), DoCopy(), EnumValuesCreate(), errtablecol(), EventTriggerSQLDropAddObject(), ExecAlterExtensionStmt(), ExecBRInsertTriggers(), ExecBRUpdateTriggers(), ExecCheckPlanOutput(), ExecDelete(), ExecGrant_Attribute(), ExecGrant_Database(), ExecGrant_Fdw(), ExecGrant_ForeignServer(), ExecGrant_Function(), ExecGrant_Language(), ExecGrant_Largeobject(), ExecGrant_Namespace(), ExecGrant_Relation(), ExecGrant_Tablespace(), ExecGrant_Type(), ExecInitBitmapHeapScan(), ExecInitForeignScan(), ExecInitIndexScan(), ExecInitTidScan(), ExecIRInsertTriggers(), ExecIRUpdateTriggers(), extension_config_remove(), file_acquire_sample_rows(), find_language_template(), generateClonedIndexStmt(), get_actual_variable_range(), get_file_fdw_attribute_options(), GetComment(), GetSecurityLabel(), GetSharedSecurityLabel(), heapgettup(), heapgettup_pagemode(), HeapSatisfiesHOTandKeyUpdate(), IndexBuildHeapScan(), IndexCheckExclusion(), initGinState(), InitializeAttributeOids(), InitScanRelation(), InsertPgAttributeTuple(), InsertPgClassTuple(), InsertRule(), inv_truncate(), inv_write(), LargeObjectCreate(), load_typcache_tupdesc(), make_inh_translation_list(), make_new_heap(), make_tuple_from_result_row(), make_viewdef(), MakeConfigurationMapping(), MergeAttributes(), MergeAttributesIntoExisting(), MergeConstraintsIntoExisting(), movedb(), NextCopyFrom(), OperatorCreate(), OperatorUpd(), pg_extension_config_dump(), pg_identify_object(), pg_largeobject_aclmask_snapshot(), postgresAcquireSampleRowsFunc(), postgresBeginForeignModify(), postgresBeginForeignScan(), postgresPlanForeignModify(), ProcedureCreate(), RangeCreate(), readtup_index(), RelationBuildRuleLock(), RelationNameGetTupleDesc(), RenameRole(), ri_KeysEqual(), sepgsql_relation_setattr_extra(), set_relation_column_names(), SetDefaultACL(), SetSecurityLabel(), SetSharedSecurityLabel(), shdepChangeDep(), spgbeginscan(), StoreCatalogInheritance1(), transformTableLikeClause(), TriggerEnabled(), TypeCreate(), update_attstats(), UpdateIndexRelation(), validate_index_heapscan(), validateCheckConstraint(), and validateDomainConstraint().
#define RelationGetFillFactor | ( | relation, | ||
defaultff | ||||
) |
((relation)->rd_options ? \ ((StdRdOptions *) (relation)->rd_options)->fillfactor : (defaultff))
Definition at line 226 of file rel.h.
Referenced by _bt_findsplitloc().
#define RelationGetForm | ( | relation | ) | ((relation)->rd_rel) |
Definition at line 277 of file rel.h.
Referenced by AlterSeqNamespaces(), build_row_from_class(), CatalogCacheInitializeCache(), change_owner_recurse_to_sequences(), ConstructTupleDescriptor(), ExecOpenIndices(), get_relation_info(), InsertOneTuple(), RelationGetIndexAttrBitmap(), rename_constraint_internal(), renameatt_internal(), ri_PerformCheck(), and ri_PlanCheck().
#define RelationGetNamespace | ( | relation | ) | ((relation)->rd_rel->relnamespace) |
Definition at line 310 of file rel.h.
Referenced by AddRelationNewConstraints(), AlterObjectNamespace_oid(), AlterTableNamespace(), ATAddForeignKeyConstraint(), ATExecAddConstraint(), copy_heap_data(), createForeignKeyTriggers(), CreateTrigger(), DefineIndex(), deparseRelation(), do_analyze_rel(), errtable(), index_constraint_create(), index_create(), IsSystemRelation(), IsToastRelation(), lazy_scan_heap(), lazy_vacuum_rel(), make_new_heap(), MergeWithExistingConstraint(), plpgsql_exec_trigger(), pltcl_init_load_unknown(), process_owned_by(), quoteRelationName(), RenameRelationInternal(), SPI_getnspname(), StoreRelCheck(), transformColumnDefinition(), and transformIndexConstraint().
#define RelationGetNumberOfAttributes | ( | relation | ) | ((relation)->rd_rel->relnatts) |
Definition at line 289 of file rel.h.
Referenced by _bt_load(), _bt_mkscankey(), _bt_mkscankey_nodata(), AlterObjectNamespace_internal(), AlterObjectOwner_internal(), AlterObjectRename_internal(), build_physical_tlist(), expand_targetlist(), get_rel_data_width(), get_relation_info(), get_rels_with_domain(), rewriteTargetListIU(), tuplesort_begin_cluster(), and tuplesort_begin_index_btree().
#define RelationGetRelationName | ( | relation | ) | (NameStr((relation)->rd_rel->relname)) |
Definition at line 303 of file rel.h.
Referenced by _bt_buildadd(), _bt_check_unique(), _bt_checkpage(), _bt_findinsertloc(), _bt_findsplitloc(), _bt_first(), _bt_get_endpoint(), _bt_getroot(), _bt_getrootheight(), _bt_gettrueroot(), _bt_insert_parent(), _bt_insertonpg(), _bt_moveright(), _bt_newroot(), _bt_pagedel(), _bt_parent_deletion_safe(), _bt_split(), _bt_start_vacuum(), _bt_walk_left(), _hash_checkpage(), _hash_datum2hashkey_type(), _hash_getnewbuf(), _hash_initbitmap(), _hash_metapinit(), _hash_pgaddtup(), acquire_sample_rows(), addRangeTableEntryForRelation(), AddRelationNewConstraints(), AlterDomainNotNull(), AlterObjectNamespace_internal(), AlterObjectOwner_internal(), AlterObjectRename_internal(), AlterTableNamespace(), analyze_rel(), ATAddForeignKeyConstraint(), ATExecAddColumn(), ATExecAddConstraint(), ATExecAddIndexConstraint(), ATExecAddInherit(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecChangeOwner(), ATExecClusterOn(), ATExecColumnDefault(), ATExecDropColumn(), ATExecDropConstraint(), ATExecDropInherit(), ATExecDropNotNull(), ATExecDropOf(), ATExecGenericOptions(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetStatistics(), ATExecSetStorage(), ATExecSetTableSpace(), ATExecValidateConstraint(), ATPrepAlterColumnType(), ATPrepSetStatistics(), ATRewriteTable(), ATRewriteTables(), ATSimplePermissions(), AttrDefaultFetch(), ATTypedTableRecursion(), ATWrongRelkindError(), BeginCopy(), BeginCopyFrom(), BeginCopyTo(), bt_metap(), bt_page_items(), bt_page_stats(), btbuild(), build_row_from_class(), CatalogCacheInitializeCache(), check_exclusion_constraint(), check_for_column_name_collision(), check_index_is_clusterable(), check_object_ownership(), CheckConstraintFetch(), checkFkeyPermissions(), checkInsertTargets(), CheckTableNotInUse(), CheckValidResultRel(), CheckValidRowMarkRel(), closerel(), CommentObject(), comparetup_index_btree(), conversion_error_callback(), copy_heap_data(), CopyFrom(), CopyGetAttnums(), count_nondeletable_pages(), CreateFakeRelcacheEntry(), createForeignKeyTriggers(), CreateTrigger(), currtid_byrelname(), currtid_byreloid(), currval_oid(), DefineIndex(), DefineQueryRewrite(), DefineVirtualRelation(), deparseRelation(), do_analyze_rel(), do_setval(), EnableDisableTrigger(), entryPlaceToPage(), entrySplitPage(), errtable(), ExecConstraints(), ExecOpenScanRelation(), ExecRefreshMatView(), ExecSecLabelStmt(), ExecuteTruncate(), file_acquire_sample_rows(), find_composite_type_dependencies(), fireRIRrules(), generate_relation_name(), generateClonedIndexStmt(), get_actual_variable_range(), get_raw_page_internal(), get_rel_from_relname(), get_relation_by_qualified_name(), GetNewOid(), ginbuild(), GinFormTuple(), ginHeapTupleFastInsert(), ginNewScanKey(), ginVacuumEntryPage(), gistbuild(), gistbulkdelete(), gistcheckpage(), gistdoinsert(), gistFindPath(), gistfixsplit(), gistplacetopage(), gistrescan(), gistUserPicksplit(), hashbuild(), hashgettuple(), heap_get_latest_tid(), heap_lock_tuple(), heap_open(), heap_openrv(), heap_openrv_extended(), index_build(), index_check_primary_key(), index_constraint_create(), index_getprocinfo(), index_open(), IndexBuildHeapScan(), init_sequence(), lastval(), lazy_cleanup_index(), lazy_scan_heap(), lazy_truncate_heap(), lazy_vacuum_heap(), lazy_vacuum_index(), lazy_vacuum_rel(), load_relcache_init_file(), make_inh_translation_list(), MergeAttributes(), MergeAttributesIntoExisting(), MergeConstraintsIntoExisting(), MergeWithExistingConstraint(), nextval_internal(), pg_sequence_parameters(), pgrowlocks(), pgstat_relation(), pgstatginindex(), pgstatindex(), plpgsql_exec_trigger(), pltcl_init_load_unknown(), postgresAcquireSampleRowsFunc(), PrintRelCacheLeakWarning(), process_owned_by(), quoteRelationName(), read_seq_tuple(), RelationBuildRuleLock(), RelationBuildTriggers(), RelationBuildTupleDesc(), RelationCacheInitializePhase3(), RelationGetBufferForTuple(), RelationGetExclusionInfo(), RelationInitIndexAccessInfo(), RelationInitPhysicalAddr(), RemoveConstraintById(), RemoveTriggerById(), renameatt_internal(), RenameRewriteRule(), renametrig(), report_triggers(), ResourceOwnerForgetRelationRef(), RewriteQuery(), rewriteTargetView(), ri_FetchConstraintInfo(), RI_FKey_check(), RI_Initial_Check(), ri_ReportViolation(), sepgsql_relation_setattr_extra(), spgbuild(), spgdoinsert(), spgGetCache(), spgprocesspending(), SPI_getrelname(), ss_get_location(), ss_report_location(), StoreAttrDefault(), StoreRelCheck(), systable_beginscan_ordered(), toast_fetch_datum(), toast_fetch_datum_slice(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformIndexConstraint(), transformTableLikeClause(), transformUpdateStmt(), triggered_change_notification(), truncate_check_rel(), vacuum_rel(), vacuumLeafPage(), validateDomainConstraint(), visibilitymap_clear(), visibilitymap_set(), visibilitymap_test(), visibilitymap_truncate(), and writeListPage().
#define RelationGetRelid | ( | relation | ) | ((relation)->rd_id) |
Definition at line 283 of file rel.h.
Referenced by _hash_has_active_scan(), acquire_inherited_sample_rows(), addRangeTableEntry(), addRangeTableEntryForRelation(), AddRelationNewConstraints(), afterTriggerInvokeEvents(), AfterTriggerSaveEvent(), AlterObjectNamespace_internal(), AlterObjectOwner_internal(), AlterObjectRename_internal(), AlterSchemaOwner_internal(), AlterSeqNamespaces(), AlterTableNamespaceInternal(), analyze_rel(), ATAddCheckConstraint(), ATAddForeignKeyConstraint(), ATExecAddColumn(), ATExecAddConstraint(), ATExecAddInherit(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecCmd(), ATExecColumnDefault(), ATExecDropColumn(), ATExecDropConstraint(), ATExecDropInherit(), ATExecDropNotNull(), ATExecDropOf(), ATExecGenericOptions(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetStatistics(), ATExecSetStorage(), ATExecSetTableSpace(), ATExecValidateConstraint(), ATGetQueueEntry(), ATPrepAlterColumnType(), ATPrepSetStatistics(), ATSimplePermissions(), ATSimpleRecursion(), AttrDefaultFetch(), BuildIndexInfo(), BuildIndexValueDescription(), CacheInvalidateHeapTuple(), CacheInvalidateRelcache(), check_for_column_name_collision(), check_index_is_clusterable(), check_object_ownership(), CheckConstraintFetch(), checkFkeyPermissions(), CheckTableNotInUse(), compute_function_hashkey(), create_toast_table(), CreateTrigger(), currtid_byrelname(), currtid_byreloid(), DefineIndex(), deparseAnalyzeSql(), deparseRelation(), do_analyze_rel(), DoCopy(), EnableDisableRule(), EnableDisableTrigger(), errtablecol(), EvalPlanQualFetchRowMarks(), execCurrentOf(), ExecGetTriggerResultRel(), ExecInsertIndexTuples(), ExecLockRows(), ExecuteTruncate(), file_acquire_sample_rows(), fileAnalyzeForeignTable(), fileBeginForeignScan(), fileExplainForeignScan(), fireRIRrules(), ForeignNext(), formrdesc(), generate_relation_name(), generateClonedIndexStmt(), get_catalog_object_by_oid(), get_object_address_attribute(), get_object_address_relobject(), get_pkey_attnames(), get_rel_data_width(), get_rel_from_relname(), get_relation_by_qualified_name(), get_rels_with_domain(), GetFdwRoutineForRelation(), GetTupleForTrigger(), heap_beginscan_internal(), heap_create_with_catalog(), heap_fetch(), heap_lock_tuple(), heap_prepare_insert(), heap_truncate_check_FKs(), heap_update(), index_build(), index_check_primary_key(), index_constraint_create(), index_create(), index_update_stats(), IndexCheckExclusion(), lazy_vacuum_rel(), load_relcache_init_file(), MergeAttributes(), MergeAttributesIntoExisting(), MergeConstraintsIntoExisting(), MergeWithExistingConstraint(), pgrowlocks(), pgstat_report_analyze(), plpython_call_handler(), pltcl_trigger_handler(), postgresAcquireSampleRowsFunc(), postgresAnalyzeForeignTable(), postgresBeginForeignModify(), postgresBeginForeignScan(), PrepareToInvalidateCacheTuple(), process_owned_by(), rebuild_relation(), reindex_relation(), RelationBuildDesc(), RelationBuildLocalRelation(), RelationBuildRuleLock(), RelationBuildTriggers(), RelationBuildTupleDesc(), RelationCacheInitializePhase3(), RelationCacheInvalidate(), RelationClearRelation(), RelationGetExclusionInfo(), RelationGetIndexList(), RelationInitIndexAccessInfo(), RelationInitLockInfo(), RelationReloadIndexInfo(), RelationSetNewRelfilenode(), RewriteQuery(), ri_FetchConstraintInfo(), RI_Initial_Check(), search_plan_tree(), SetRelationNumChecks(), StoreAttrDefault(), StoreRelCheck(), systable_beginscan_ordered(), TidListCreate(), toast_save_datum(), transformIndexConstraint(), transformTableLikeClause(), truncate_check_rel(), vac_update_relstats(), vacuum_rel(), validateForeignKeyConstraint(), and write_relcache_init_file().
#define RelationGetTargetBlock | ( | relation | ) | ( (relation)->rd_smgr != NULL ? (relation)->rd_smgr->smgr_targblock : InvalidBlockNumber ) |
Definition at line 355 of file rel.h.
Referenced by copy_heap_data(), intorel_startup(), RelationGetBufferForTuple(), and transientrel_startup().
#define RelationGetTargetPageFreeSpace | ( | relation, | ||
defaultff | ||||
) | (BLCKSZ * (100 - RelationGetFillFactor(relation, defaultff)) / 100) |
Definition at line 241 of file rel.h.
Referenced by _bt_pagestate(), heap_multi_insert(), heap_page_prune_opt(), raw_heap_insert(), RelationGetBufferForTuple(), and SpGistGetBuffer().
#define RelationGetTargetPageUsage | ( | relation, | ||
defaultff | ||||
) | (BLCKSZ * RelationGetFillFactor(relation, defaultff) / 100) |
Definition at line 234 of file rel.h.
Referenced by _hash_metapinit().
#define RelationHasReferenceCountZero | ( | relation | ) | ((bool)((relation)->rd_refcnt == 0)) |
Definition at line 267 of file rel.h.
Referenced by RelationCacheInvalidate(), RelationClearRelation(), RelationClose(), RelationDestroyRelation(), RelationFlushRelation(), and RelationForgetRelation().
#define RelationIsMapped | ( | relation | ) | ((relation)->rd_rel->relfilenode == InvalidOid) |
Definition at line 320 of file rel.h.
Referenced by ATExecSetTableSpace(), create_toast_table(), index_create(), make_new_heap(), RelationCacheInvalidate(), and RelationSetNewRelfilenode().
#define RelationIsScannable | ( | relation | ) | ((relation)->rd_ispopulated) |
Definition at line 411 of file rel.h.
Referenced by ExecOpenScanRelation(), and pg_relation_is_scannable().
#define RelationIsSecurityView | ( | relation | ) |
((relation)->rd_options ? \ ((StdRdOptions *) (relation)->rd_options)->security_barrier : false)
Definition at line 248 of file rel.h.
Referenced by ApplyRetrieveRule(), and view_is_auto_updatable().
#define RelationIsValid | ( | relation | ) | PointerIsValid(relation) |
Definition at line 256 of file rel.h.
Referenced by index_build(), PrefetchBuffer(), PrepareToInvalidateCacheTuple(), relation_open(), RelationIdGetRelation(), RelationInitLockInfo(), and try_relation_open().
#define RelationNeedsWAL | ( | relation | ) | ((relation)->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT) |
Definition at line 372 of file rel.h.
Referenced by _bt_delitems_delete(), _bt_delitems_vacuum(), _bt_getroot(), _bt_insertonpg(), _bt_leafbuild(), _bt_load(), _bt_log_reuse_page(), _bt_newroot(), _bt_pagedel(), _bt_split(), addLeafTuple(), AlterSequence(), copy_heap_data(), createPostingTree(), do_setval(), doPickSplit(), end_heap_rewrite(), fill_seq_with_data(), get_relation_info(), ginbuild(), ginDeletePage(), ginHeapTupleFastInsert(), ginInsertValue(), ginUpdateStats(), gistbuild(), gistbulkdelete(), gistdoinsert(), gistplacetopage(), heap_delete(), heap_inplace_update(), heap_insert(), heap_lock_tuple(), heap_lock_updated_tuple_rec(), heap_multi_insert(), heap_page_prune(), heap_sync(), heap_update(), lazy_scan_heap(), lazy_vacuum_page(), log_heap_clean(), log_heap_freeze(), log_heap_update(), moveLeafs(), nextval_internal(), RelationTruncate(), SetMatViewToPopulated(), shiftList(), spgAddNodeAction(), spgbuild(), spgSplitNodeAction(), vacuum_log_cleanup_info(), vacuumLeafPage(), vacuumLeafRoot(), vacuumRedirectAndPlaceholder(), visibilitymap_set(), writeListPage(), and xlogVacuumPage().
#define RelationOpenSmgr | ( | relation | ) |
do { \ if ((relation)->rd_smgr == NULL) \ smgrsetowner(&((relation)->rd_smgr), smgropen((relation)->rd_node, (relation)->rd_backend)); \ } while (0)
Definition at line 327 of file rel.h.
Referenced by _bt_blwritepage(), _bt_load(), _hash_alloc_buckets(), ATExecSetTableSpace(), end_heap_rewrite(), FlushRelationBuffers(), FreeSpaceMapTruncateRel(), fsm_extend(), fsm_readbuf(), heap_create(), heap_create_init_fork(), heap_is_matview_init_state(), index_build(), PrefetchBuffer(), raw_heap_insert(), ReadBufferExtended(), RelationGetNumberOfBlocksInFork(), RelationTruncate(), SetMatViewToPopulated(), visibilitymap_truncate(), vm_extend(), and vm_readbuf().
#define RelationSetTargetBlock | ( | relation, | ||
targblock | ||||
) |
do { \ RelationOpenSmgr(relation); \ (relation)->rd_smgr->smgr_targblock = (targblock); \ } while (0)
Definition at line 362 of file rel.h.
Referenced by fill_seq_with_data(), and RelationGetBufferForTuple().
#define RelationUsesLocalBuffers | ( | relation | ) | ((relation)->rd_rel->relpersistence == RELPERSISTENCE_TEMP) |
Definition at line 379 of file rel.h.
Referenced by FlushRelationBuffers(), initscan(), PredicateLockingNeededForRelation(), PrefetchBuffer(), relation_open(), and try_relation_open().
typedef struct AutoVacOpts AutoVacOpts |
typedef LockInfoData* LockInfo |
typedef struct LockInfoData LockInfoData |
typedef struct RelationAmInfo RelationAmInfo |
typedef struct RelationData RelationData |
typedef struct StdRdOptions StdRdOptions |
void RelationDecrementReferenceCount | ( | Relation | rel | ) |
Definition at line 1647 of file relcache.c.
References Assert, CurrentResourceOwner, IsBootstrapProcessingMode, RelationData::rd_refcnt, and ResourceOwnerForgetRelationRef().
Referenced by heap_endscan(), index_endscan(), RelationCacheInitializePhase3(), RelationClose(), and RelationFlushRelation().
{ Assert(rel->rd_refcnt > 0); rel->rd_refcnt -= 1; if (!IsBootstrapProcessingMode()) ResourceOwnerForgetRelationRef(CurrentResourceOwner, rel); }
void RelationIncrementReferenceCount | ( | Relation | rel | ) |
Definition at line 1634 of file relcache.c.
References CurrentResourceOwner, IsBootstrapProcessingMode, RelationData::rd_refcnt, ResourceOwnerEnlargeRelationRefs(), and ResourceOwnerRememberRelationRef().
Referenced by heap_beginscan_internal(), index_beginscan_internal(), RelationBuildLocalRelation(), RelationCacheInitializePhase3(), RelationFlushRelation(), and RelationIdGetRelation().
{ ResourceOwnerEnlargeRelationRefs(CurrentResourceOwner); rel->rd_refcnt += 1; if (!IsBootstrapProcessingMode()) ResourceOwnerRememberRelationRef(CurrentResourceOwner, rel); }