PostgreSQL Source Code  git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
table.c File Reference
#include "postgres.h"
#include "access/relation.h"
#include "access/table.h"
#include "utils/rel.h"
Include dependency graph for table.c:

Go to the source code of this file.

Functions

static void validate_relation_kind (Relation r)
 
Relation table_open (Oid relationId, LOCKMODE lockmode)
 
Relation try_table_open (Oid relationId, LOCKMODE lockmode)
 
Relation table_openrv (const RangeVar *relation, LOCKMODE lockmode)
 
Relation table_openrv_extended (const RangeVar *relation, LOCKMODE lockmode, bool missing_ok)
 
void table_close (Relation relation, LOCKMODE lockmode)
 

Function Documentation

◆ table_close()

void table_close ( Relation  relation,
LOCKMODE  lockmode 
)

Definition at line 126 of file table.c.

127 {
128  relation_close(relation, lockmode);
129 }
void relation_close(Relation relation, LOCKMODE lockmode)
Definition: relation.c:205

References relation_close().

Referenced by _brin_parallel_build_main(), _bt_parallel_build_main(), acquire_inherited_sample_rows(), AcquireRewriteLocks(), AddEnumLabel(), addFkRecurseReferenced(), addFkRecurseReferencing(), AddNewAttributeTuples(), addRangeTableEntry(), AddRoleMems(), AddSubscriptionRelState(), AdjustNotNullInheritance(), AfterTriggerSetState(), AggregateCreate(), AlterCollation(), AlterConstraintNamespaces(), AlterDatabase(), AlterDatabaseOwner(), AlterDatabaseRefreshColl(), AlterDomainAddConstraint(), AlterDomainDefault(), AlterDomainDropConstraint(), AlterDomainNotNull(), AlterDomainValidateConstraint(), AlterEventTrigger(), AlterEventTriggerOwner(), AlterEventTriggerOwner_oid(), AlterExtensionNamespace(), AlterForeignDataWrapper(), AlterForeignDataWrapperOwner(), AlterForeignDataWrapperOwner_oid(), AlterForeignServer(), AlterForeignServerOwner(), AlterForeignServerOwner_oid(), AlterFunction(), AlterObjectNamespace_oid(), AlterObjectOwner_internal(), AlterOperator(), AlterPolicy(), AlterPublication(), AlterPublicationOwner(), AlterPublicationOwner_oid(), AlterRole(), AlterSchemaOwner(), AlterSchemaOwner_oid(), AlterSequence(), AlterSetting(), AlterStatistics(), AlterSubscription(), AlterSubscription_refresh(), AlterSubscriptionOwner(), AlterSubscriptionOwner_oid(), AlterTableMoveAll(), AlterTableNamespaceInternal(), AlterTableSpaceOptions(), AlterTSConfiguration(), AlterTSDictionary(), AlterType(), AlterTypeNamespaceInternal(), AlterTypeOwner(), AlterTypeOwner_oid(), AlterTypeOwnerInternal(), AlterUserMapping(), AppendAttributeTuples(), apply_handle_truncate(), ApplyExtensionUpdates(), AssignTypeArrayOid(), AssignTypeMultirangeArrayOid(), AssignTypeMultirangeOid(), ATAddCheckNNConstraint(), ATAddForeignKeyConstraint(), ATCheckPartitionsNotInUse(), ATDetachCheckNoForeignKeyRefs(), ATExecAddColumn(), ATExecAddIdentity(), ATExecAddInherit(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecAlterConstraint(), ATExecAlterConstrRecurse(), ATExecAttachPartition(), ATExecChangeOwner(), ATExecDetachPartition(), ATExecDetachPartitionFinalize(), ATExecDropColumn(), ATExecDropConstraint(), ATExecDropExpression(), ATExecDropIdentity(), ATExecDropInherit(), ATExecDropNotNull(), ATExecDropOf(), ATExecForceNoForceRowSecurity(), ATExecGenericOptions(), ATExecSetAccessMethodNoStorage(), ATExecSetCompression(), ATExecSetIdentity(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetRowSecurity(), ATExecSetStatistics(), ATExecSetStorage(), ATExecValidateConstraint(), ATPrepChangePersistence(), ATRewriteTable(), ATRewriteTables(), AttrDefaultFetch(), attribute_statistics_update(), binary_upgrade_add_sub_rel_state(), binary_upgrade_replorigin_advance(), BootstrapToastTable(), bringetbitmap(), brinvacuumcleanup(), bt_index_check_internal(), build_indices(), build_physical_tlist(), BuildRelationExtStatistics(), CastCreate(), CatalogCacheInitializeCache(), change_owner_fix_column_acls(), changeDependenciesOf(), changeDependenciesOn(), changeDependencyFor(), changeDependencyOnOwner(), changeDependencyOnTablespace(), check_db_file_conflict(), check_default_partition_contents(), check_selective_binary_conversion(), CheckAndCreateToastTable(), CheckConstraintFetch(), checkSharedDependencies(), ChooseConstraintName(), clear_subscription_skip_lsn(), CloneFkReferenced(), CloneFkReferencing(), CloneRowTriggersToPartition(), close_lo_relation(), closerel(), CloseTableList(), cluster(), CollationCreate(), ComputeExtStatisticsRows(), ConstraintNameExists(), ConstraintNameIsUsed(), ConstraintSetParentConstraint(), ConversionCreate(), copy_table_data(), CopyStatistics(), copyTemplateDependencies(), CountDBSubscriptions(), create_toast_table(), CreateAccessMethod(), CreateComments(), CreateConstraintEntry(), CreateDatabaseUsingFileCopy(), createdb(), CreateForeignDataWrapper(), CreateForeignServer(), CreateForeignTable(), CreateInheritance(), CreateOpFamily(), CreatePolicy(), CreateProceduralLanguage(), CreatePublication(), CreateRole(), CreateSharedComments(), CreateSubscription(), CreateTableSpace(), CreateTransform(), CreateTriggerFiringOn(), CreateUserMapping(), currtid_byrelname(), currtid_for_view(), database_to_xmlschema_internal(), DefineIndex(), DefineOpClass(), DefineQueryRewrite(), DefineRelation(), DefineSequence(), DefineTSConfiguration(), DefineTSDictionary(), DefineTSParser(), DefineTSTemplate(), delete_pg_statistic(), DeleteAttributeTuples(), DeleteComments(), deleteDependencyRecordsFor(), deleteDependencyRecordsForClass(), deleteDependencyRecordsForSpecific(), DeleteInheritsTuple(), DeleteInitPrivs(), deleteOneObject(), DeleteRelationTuple(), DeleteSecurityLabel(), DeleteSequenceTuple(), DeleteSharedComments(), deleteSharedDependencyRecordsFor(), DeleteSharedSecurityLabel(), DeleteSystemAttributeTuples(), DelRoleMems(), deparseColumnRef(), deparseFromExprForRel(), deparseSelectSql(), DetachPartitionFinalize(), DisableSubscription(), distribute_row_identity_vars(), do_autovacuum(), DoCopy(), drop_parent_dependency(), DropClonedTriggersFromPartition(), dropconstraint_internal(), dropDatabaseDependencies(), dropdb(), DropObjectById(), DropRole(), DropSetting(), DropSubscription(), DropTableSpace(), EnableDisableRule(), EnableDisableTrigger(), ENRMetadataGetTupDesc(), enum_endpoint(), enum_range_internal(), EnumValuesCreate(), EnumValuesDelete(), EventTriggerOnLogin(), EventTriggerSQLDropAddObject(), exec_object_restorecon(), ExecAlterExtensionStmt(), ExecAlterObjectDependsStmt(), ExecAlterObjectSchemaStmt(), ExecCleanupTupleRouting(), ExecCloseRangeTableRelations(), ExecCloseResultRelations(), ExecGrant_common(), ExecGrant_Largeobject(), ExecGrant_Parameter(), ExecGrant_Relation(), ExecRenameStmt(), ExecuteTruncate(), ExecuteTruncateGuts(), expand_inherited_rtentry(), expand_partitioned_rtentry(), expandTableLikeClause(), extension_config_remove(), find_inheritance_children_extended(), find_typed_table_dependencies(), findDomainNotNullConstraint(), findNotNullConstraintAttnum(), finish_heap_swap(), fireRIRrules(), free_parsestate(), get_actual_variable_range(), get_all_vacuum_rels(), get_database_list(), get_database_oid(), get_db_info(), get_dependent_generated_columns(), get_domain_constraint_oid(), get_file_fdw_attribute_options(), get_index_constraint(), get_index_ref_constraints(), get_object_address_relobject(), get_partition_ancestors(), get_partition_parent(), get_pkey_attnames(), get_primary_key_attnos(), get_relation_constraint_attnos(), get_relation_constraint_oid(), get_relation_constraints(), get_relation_data_width(), get_relation_idx_constraint_oid(), get_relation_info(), get_relation_policy_oid(), get_row_security_policies(), get_subscription_list(), get_tablespace_name(), get_tablespace_oid(), get_trigger_oid(), GetAllTablesPublicationRelations(), GetAllTablesPublications(), GetAttrDefaultColumnAddress(), GetAttrDefaultOid(), getAutoExtensionsOfObject(), GetComment(), getConstraintTypeDescription(), GetDatabaseTuple(), GetDatabaseTupleByOid(), GetDefaultOpClass(), getExtensionOfObject(), getObjectDescription(), getObjectIdentityParts(), getOwnedSequences_internal(), GetParentedForeignKeyRefs(), GetPublicationRelations(), GetPublicationSchemas(), getRelationsInNamespace(), GetSchemaPublicationRelations(), GetSecurityLabel(), GetSharedSecurityLabel(), GetSubscriptionRelations(), GetSubscriptionRelState(), GrantRole(), has_row_triggers(), has_stored_generated_columns(), has_superclass(), HasSubscriptionRelations(), heap_create_with_catalog(), heap_drop_with_catalog(), heap_truncate(), heap_truncate_find_FKs(), heap_truncate_one_rel(), index_build(), index_concurrently_build(), index_concurrently_set_dead(), index_concurrently_swap(), index_constraint_create(), index_create(), index_drop(), index_set_state_flags(), index_update_stats(), infer_arbiter_indexes(), insert_event_trigger_tuple(), InsertExtensionTuple(), InsertRule(), intorel_shutdown(), is_schema_publication(), isQueryUsingTempRelation_walker(), LargeObjectCreate(), LargeObjectDrop(), LargeObjectExistsWithSnapshot(), load_domaintype_info(), load_enum_cache_data(), LockViewRecurse(), logicalrep_rel_close(), logicalrep_rel_open(), LogicalRepSyncTableStart(), lookup_ts_config_cache(), LookupOpclassInfo(), make_new_heap(), make_ruledef(), make_viewdef(), mark_index_clustered(), MarkInheritDetached(), MergeAttributes(), MergeAttributesIntoExisting(), MergeConstraintsIntoExisting(), MergeWithExistingConstraint(), movedb(), NamespaceCreate(), object_ownercheck(), objectsInSchemaToOids(), OpenTableList(), OperatorCreate(), OperatorShellMake(), OperatorUpd(), parallel_vacuum_main(), ParameterAclCreate(), PartitionHasPendingDetach(), performDeletion(), performMultipleDeletions(), pg_event_trigger_ddl_commands(), pg_extension_config_dump(), pg_get_acl(), pg_get_constraintdef_worker(), pg_get_publication_tables(), pg_get_replica_identity_index(), pg_get_serial_sequence(), pg_get_triggerdef_worker(), pg_identify_object(), pg_largeobject_aclmask_snapshot(), pg_nextoid(), pgrowlocks(), plan_create_index_workers(), populate_typ_list(), postgresPlanDirectModify(), postgresPlanForeignModify(), preprocess_targetlist(), ProcedureCreate(), process_settings(), publication_add_relation(), publication_add_schema(), QueuePartitionConstraintValidation(), RangeCreate(), RangeDelete(), rebuild_relation(), recordExtensionInitPrivWorker(), recordMultipleDependencies(), recordSharedDependencyOn(), refresh_by_match_merge(), RefreshMatViewByOid(), reindex_index(), reindex_relation(), ReindexMultipleTables(), ReindexRelationConcurrently(), relation_has_policies(), relation_mark_replica_identity(), relation_statistics_update(), RelationBuildPartitionDesc(), RelationBuildRowSecurity(), RelationBuildRuleLock(), RelationBuildTriggers(), RelationBuildTupleDesc(), RelationClearMissing(), RelationGetExclusionInfo(), RelationGetFKeyList(), RelationGetIndexList(), RelationGetNotNullConstraints(), RelationGetStatExtList(), RelationRemoveInheritance(), RelationSetNewRelfilenumber(), RelidByRelfilenumber(), RememberAllDependentForRebuilding(), remove_dbtablespaces(), RemoveAttrDefault(), RemoveAttrDefaultById(), RemoveAttributeById(), RemoveConstraintById(), RemoveExtensionById(), RemoveFunctionById(), RemoveInheritance(), RemoveObjects(), RemoveOperatorById(), RemovePartitionKeyByRelId(), RemovePolicyById(), RemovePublicationById(), RemovePublicationRelById(), RemovePublicationSchemaById(), RemoveRewriteRuleById(), RemoveRoleFromInitPriv(), RemoveRoleFromObjectACL(), RemoveRoleFromObjectPolicy(), RemoveStatistics(), RemoveStatisticsById(), RemoveStatisticsDataById(), RemoveSubscriptionRel(), RemoveTriggerById(), RemoveTSConfigurationById(), RemoveTypeById(), rename_policy(), renameatt_internal(), RenameConstraint(), RenameConstraintById(), RenameDatabase(), RenameEnumLabel(), RenameRelationInternal(), RenameRewriteRule(), RenameRole(), RenameSchema(), RenameTableSpace(), renametrig(), renametrig_partition(), RenameType(), RenameTypeInternal(), ReplaceRoleInInitPriv(), replorigin_create(), replorigin_drop_by_name(), ResetRelRewrite(), RewriteQuery(), rewriteTargetView(), RI_FKey_cascade_del(), RI_FKey_cascade_upd(), RI_FKey_check(), ri_restrict(), ri_set(), ScanPgRelation(), schema_to_xmlschema_internal(), SearchCatCacheList(), SearchCatCacheMiss(), sepgsql_attribute_post_create(), sepgsql_database_post_create(), sepgsql_index_modify(), sepgsql_proc_post_create(), sepgsql_proc_setattr(), sepgsql_relation_post_create(), sepgsql_relation_setattr(), sepgsql_schema_post_create(), sequenceIsOwned(), serialize_expr_stats(), set_attnotnull(), SetAttrMissing(), SetDatabaseHasLoginEventTriggers(), SetDefaultACL(), SetMatViewPopulatedState(), SetRelationHasSubclass(), SetRelationNumChecks(), SetRelationRuleStatus(), SetRelationTableSpace(), SetSecurityLabel(), SetSharedSecurityLabel(), setTargetTable(), shdepDropOwned(), shdepReassignOwned(), statext_store(), StoreAttrDefault(), StoreCatalogInheritance(), storeOperators(), StorePartitionBound(), StorePartitionKey(), storeProcedures(), StoreSingleInheritance(), swap_relation_files(), table_to_xml_and_xmlschema(), table_to_xmlschema(), test_copy_to_callback(), ThereIsAtLeastOneRole(), toast_delete_datum(), toast_fetch_datum(), toast_fetch_datum_slice(), toast_get_valid_index(), toast_save_datum(), toastid_valueid_exists(), transformIndexConstraint(), transformIndexStmt(), transformRuleStmt(), transformStatsStmt(), transformTableLikeClause(), transientrel_shutdown(), tryAttachPartitionForeignKey(), TypeCreate(), typeInheritsFrom(), TypeShellMake(), update_attstats(), update_default_partition_oid(), update_relispartition(), updateAclDependenciesWorker(), UpdateIndexRelation(), UpdateSubscriptionRelState(), UpdateTwoPhaseState(), vac_truncate_clog(), vac_update_datfrozenxid(), vac_update_relstats(), validate_index(), validateDomainCheckConstraint(), validateDomainNotNullConstraint(), validatePartitionedIndex(), and verify_heapam().

◆ table_open()

Relation table_open ( Oid  relationId,
LOCKMODE  lockmode 
)

Definition at line 40 of file table.c.

41 {
42  Relation r;
43 
44  r = relation_open(relationId, lockmode);
45 
47 
48  return r;
49 }
Relation relation_open(Oid relationId, LOCKMODE lockmode)
Definition: relation.c:47
static void validate_relation_kind(Relation r)
Definition: table.c:138

References relation_open(), and validate_relation_kind().

Referenced by _brin_parallel_build_main(), _bt_parallel_build_main(), acquire_inherited_sample_rows(), AcquireRewriteLocks(), AddEnumLabel(), addFkRecurseReferenced(), addFkRecurseReferencing(), AddNewAttributeTuples(), AddRoleMems(), AddSubscriptionRelState(), AdjustNotNullInheritance(), AfterTriggerSetState(), AggregateCreate(), AlterCollation(), AlterConstraintNamespaces(), AlterDatabase(), AlterDatabaseOwner(), AlterDatabaseRefreshColl(), AlterDomainAddConstraint(), AlterDomainDefault(), AlterDomainDropConstraint(), AlterDomainNotNull(), AlterDomainValidateConstraint(), AlterEventTrigger(), AlterEventTriggerOwner(), AlterEventTriggerOwner_oid(), AlterExtensionNamespace(), AlterForeignDataWrapper(), AlterForeignDataWrapperOwner(), AlterForeignDataWrapperOwner_oid(), AlterForeignServer(), AlterForeignServerOwner(), AlterForeignServerOwner_oid(), AlterFunction(), AlterObjectNamespace_oid(), AlterObjectOwner_internal(), AlterOperator(), AlterPolicy(), AlterPublication(), AlterPublicationOwner(), AlterPublicationOwner_oid(), AlterPublicationTables(), AlterRole(), AlterSchemaOwner(), AlterSchemaOwner_oid(), AlterSeqNamespaces(), AlterSequence(), AlterSetting(), AlterStatistics(), AlterSubscription(), AlterSubscription_refresh(), AlterSubscriptionOwner(), AlterSubscriptionOwner_oid(), AlterTableMoveAll(), AlterTableNamespaceInternal(), AlterTableSpaceOptions(), AlterTSConfiguration(), AlterTSDictionary(), AlterType(), AlterTypeNamespaceInternal(), AlterTypeOwner(), AlterTypeOwner_oid(), AlterTypeOwnerInternal(), AlterUserMapping(), AppendAttributeTuples(), apply_handle_truncate(), ApplyExtensionUpdates(), AssignTypeArrayOid(), AssignTypeMultirangeArrayOid(), AssignTypeMultirangeOid(), ATAddCheckNNConstraint(), ATAddForeignKeyConstraint(), ATCheckPartitionsNotInUse(), ATDetachCheckNoForeignKeyRefs(), ATExecAddColumn(), ATExecAddIdentity(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecAlterConstraint(), ATExecAlterConstrRecurse(), ATExecAttachPartition(), ATExecChangeOwner(), ATExecDropColumn(), ATExecDropConstraint(), ATExecDropExpression(), ATExecDropIdentity(), ATExecDropNotNull(), ATExecDropOf(), ATExecForceNoForceRowSecurity(), ATExecGenericOptions(), ATExecSetAccessMethodNoStorage(), ATExecSetCompression(), ATExecSetIdentity(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetRowSecurity(), ATExecSetStatistics(), ATExecSetStorage(), ATExecValidateConstraint(), ATPrepChangePersistence(), ATRewriteTable(), ATRewriteTables(), AttrDefaultFetch(), attribute_statistics_update(), binary_upgrade_add_sub_rel_state(), binary_upgrade_replorigin_advance(), brin_desummarize_range(), brin_summarize_range(), bringetbitmap(), brinvacuumcleanup(), bt_index_check_internal(), build_indices(), build_physical_tlist(), BuildRelationExtStatistics(), CastCreate(), CatalogCacheInitializeCache(), change_owner_fix_column_acls(), change_owner_recurse_to_sequences(), changeDependenciesOf(), changeDependenciesOn(), changeDependencyFor(), changeDependencyOnOwner(), changeDependencyOnTablespace(), check_db_file_conflict(), check_default_partition_contents(), check_selective_binary_conversion(), CheckAndCreateToastTable(), CheckConstraintFetch(), checkSharedDependencies(), ChooseConstraintName(), clear_subscription_skip_lsn(), CloneFkReferenced(), CloneFkReferencing(), CloneRowTriggersToPartition(), cluster(), CollationCreate(), ComputeExtStatisticsRows(), ConstraintNameExists(), ConstraintNameIsUsed(), ConstraintSetParentConstraint(), ConversionCreate(), copy_table_data(), CopyStatistics(), copyTemplateDependencies(), CountDBSubscriptions(), create_toast_table(), CreateAccessMethod(), CreateComments(), CreateConstraintEntry(), CreateDatabaseUsingFileCopy(), createdb(), CreateForeignDataWrapper(), CreateForeignServer(), CreateForeignTable(), CreateInheritance(), CreateOpFamily(), CreatePolicy(), CreateProceduralLanguage(), CreatePublication(), CreateRole(), CreateSharedComments(), CreateStatistics(), CreateSubscription(), CreateTableSpace(), CreateTransform(), CreateTriggerFiringOn(), CreateUserMapping(), currtid_for_view(), database_to_xmlschema_internal(), DefineIndex(), DefineOpClass(), DefineQueryRewrite(), DefineRelation(), DefineSequence(), DefineTSConfiguration(), DefineTSDictionary(), DefineTSParser(), DefineTSTemplate(), delete_pg_statistic(), DeleteAttributeTuples(), DeleteComments(), deleteDependencyRecordsFor(), deleteDependencyRecordsForClass(), deleteDependencyRecordsForSpecific(), DeleteInheritsTuple(), DeleteInitPrivs(), deleteOneObject(), DeleteRelationTuple(), DeleteSecurityLabel(), DeleteSequenceTuple(), DeleteSharedComments(), deleteSharedDependencyRecordsFor(), DeleteSharedSecurityLabel(), DeleteSystemAttributeTuples(), DelRoleMems(), deparseColumnRef(), deparseFromExprForRel(), deparseSelectSql(), DetachPartitionFinalize(), DisableSubscription(), distribute_row_identity_vars(), do_autovacuum(), drop_parent_dependency(), DropClonedTriggersFromPartition(), dropconstraint_internal(), dropDatabaseDependencies(), dropdb(), DropObjectById(), DropRole(), DropSetting(), DropSubscription(), DropTableSpace(), EnableDisableRule(), EnableDisableTrigger(), ENRMetadataGetTupDesc(), enum_endpoint(), enum_range_internal(), EnumValuesCreate(), EnumValuesDelete(), EventTriggerOnLogin(), EventTriggerSQLDropAddObject(), exec_object_restorecon(), ExecAlterExtensionStmt(), ExecAlterObjectSchemaStmt(), ExecGetAncestorResultRels(), ExecGetRangeTableRelation(), ExecGetTriggerResultRel(), ExecGrant_common(), ExecGrant_Largeobject(), ExecGrant_Parameter(), ExecGrant_Relation(), ExecInitPartitionDispatchInfo(), ExecInitPartitionInfo(), ExecRenameStmt(), ExecuteTruncate(), ExecuteTruncateGuts(), expand_inherited_rtentry(), extension_config_remove(), find_composite_type_dependencies(), find_inheritance_children_extended(), find_typed_table_dependencies(), findDomainNotNullConstraint(), findNotNullConstraintAttnum(), finish_heap_swap(), fireRIRrules(), get_actual_variable_range(), get_all_vacuum_rels(), get_database_list(), get_database_oid(), get_db_info(), get_dependent_generated_columns(), get_domain_constraint_oid(), get_file_fdw_attribute_options(), get_index_constraint(), get_index_ref_constraints(), get_partition_ancestors(), get_partition_parent(), get_pkey_attnames(), get_primary_key_attnos(), get_relation_constraint_attnos(), get_relation_constraint_oid(), get_relation_constraints(), get_relation_data_width(), get_relation_idx_constraint_oid(), get_relation_info(), get_relation_policy_oid(), get_rels_with_domain(), get_row_security_policies(), get_subscription_list(), get_tables_to_cluster(), get_tablespace_name(), get_tablespace_oid(), get_trigger_oid(), GetAllTablesPublicationRelations(), GetAllTablesPublications(), GetAttrDefaultColumnAddress(), GetAttrDefaultOid(), getAutoExtensionsOfObject(), GetComment(), getConstraintTypeDescription(), GetDatabaseTuple(), GetDatabaseTupleByOid(), GetDefaultOpClass(), getExtensionOfObject(), getObjectDescription(), getObjectIdentityParts(), getOwnedSequences_internal(), GetParentedForeignKeyRefs(), GetPublicationRelations(), GetPublicationSchemas(), getRelationsInNamespace(), GetSchemaPublicationRelations(), GetSecurityLabel(), GetSharedSecurityLabel(), GetSubscriptionRelations(), GetSubscriptionRelState(), GrantRole(), has_row_triggers(), has_stored_generated_columns(), has_superclass(), HasSubscriptionRelations(), heap_create_with_catalog(), heap_drop_with_catalog(), heap_truncate(), heap_truncate_find_FKs(), heap_truncate_one_rel(), index_build(), index_concurrently_build(), index_concurrently_set_dead(), index_concurrently_swap(), index_constraint_create(), index_create(), index_drop(), index_set_state_flags(), index_update_stats(), infer_arbiter_indexes(), insert_event_trigger_tuple(), InsertExtensionTuple(), InsertRule(), intorel_startup(), is_schema_publication(), isQueryUsingTempRelation_walker(), LargeObjectCreate(), LargeObjectDrop(), LargeObjectExistsWithSnapshot(), load_domaintype_info(), load_enum_cache_data(), LockViewRecurse(), logicalrep_rel_open(), LogicalRepSyncTableStart(), lookup_ts_config_cache(), LookupOpclassInfo(), make_new_heap(), make_ruledef(), make_viewdef(), mark_index_clustered(), MarkInheritDetached(), MergeAttributes(), MergeAttributesIntoExisting(), MergeConstraintsIntoExisting(), MergeWithExistingConstraint(), movedb(), NamespaceCreate(), object_ownercheck(), objectsInSchemaToOids(), open_lo_relation(), OpenTableList(), OperatorCreate(), OperatorShellMake(), OperatorUpd(), parallel_vacuum_main(), ParameterAclCreate(), PartitionHasPendingDetach(), performDeletion(), performMultipleDeletions(), pg_event_trigger_ddl_commands(), pg_extension_config_dump(), pg_get_acl(), pg_get_constraintdef_worker(), pg_get_publication_tables(), pg_get_replica_identity_index(), pg_get_serial_sequence(), pg_get_triggerdef_worker(), pg_identify_object(), pg_largeobject_aclmask_snapshot(), pg_nextoid(), plan_create_index_workers(), populate_typ_list(), postgresPlanDirectModify(), postgresPlanForeignModify(), preprocess_targetlist(), ProcedureCreate(), process_settings(), publication_add_relation(), publication_add_schema(), QueuePartitionConstraintValidation(), RangeCreate(), RangeDelete(), recordExtensionInitPrivWorker(), recordExtObjInitPriv(), recordMultipleDependencies(), recordSharedDependencyOn(), refresh_by_match_merge(), RefreshMatViewByOid(), reindex_index(), reindex_relation(), ReindexMultipleTables(), ReindexRelationConcurrently(), relation_has_policies(), relation_mark_replica_identity(), relation_statistics_update(), RelationBuildPartitionDesc(), RelationBuildRowSecurity(), RelationBuildRuleLock(), RelationBuildTriggers(), RelationBuildTupleDesc(), RelationClearMissing(), RelationGetExclusionInfo(), RelationGetFKeyList(), RelationGetIndexList(), RelationGetNotNullConstraints(), RelationGetStatExtList(), RelationRemoveInheritance(), RelationSetNewRelfilenumber(), RelidByRelfilenumber(), RememberAllDependentForRebuilding(), remove_dbtablespaces(), RemoveAttrDefault(), RemoveAttrDefaultById(), RemoveAttributeById(), RemoveConstraintById(), RemoveExtensionById(), RemoveFunctionById(), RemoveInheritance(), RemoveOperatorById(), RemovePartitionKeyByRelId(), RemovePolicyById(), RemovePublicationById(), RemovePublicationRelById(), RemovePublicationSchemaById(), RemoveRewriteRuleById(), RemoveRoleFromInitPriv(), RemoveRoleFromObjectACL(), RemoveRoleFromObjectPolicy(), RemoveStatistics(), RemoveStatisticsById(), RemoveStatisticsDataById(), RemoveSubscriptionRel(), RemoveTriggerById(), RemoveTSConfigurationById(), RemoveTypeById(), rename_policy(), renameatt_internal(), RenameConstraint(), RenameConstraintById(), RenameDatabase(), RenameEnumLabel(), RenameRelationInternal(), RenameRewriteRule(), RenameRole(), RenameSchema(), RenameTableSpace(), renametrig(), renametrig_partition(), RenameType(), RenameTypeInternal(), ReplaceRoleInInitPriv(), replorigin_create(), replorigin_drop_by_name(), ResetRelRewrite(), RewriteQuery(), rewriteTargetView(), RI_FKey_cascade_del(), RI_FKey_cascade_upd(), RI_FKey_check(), ri_restrict(), ri_set(), ScanPgRelation(), schema_to_xmlschema_internal(), SearchCatCacheList(), SearchCatCacheMiss(), sepgsql_attribute_post_create(), sepgsql_database_post_create(), sepgsql_index_modify(), sepgsql_proc_post_create(), sepgsql_proc_setattr(), sepgsql_relation_post_create(), sepgsql_relation_setattr(), sepgsql_schema_post_create(), sequenceIsOwned(), serialize_expr_stats(), set_attnotnull(), SetAttrMissing(), SetDatabaseHasLoginEventTriggers(), SetDefaultACL(), SetMatViewPopulatedState(), SetRelationHasSubclass(), SetRelationNumChecks(), SetRelationRuleStatus(), SetRelationTableSpace(), SetSecurityLabel(), SetSharedSecurityLabel(), shdepDropOwned(), shdepReassignOwned(), statext_store(), StoreAttrDefault(), StoreCatalogInheritance(), storeOperators(), StorePartitionBound(), StorePartitionKey(), storeProcedures(), StoreSingleInheritance(), swap_relation_files(), table_to_xml_and_xmlschema(), table_to_xmlschema(), test_copy_to_callback(), ThereIsAtLeastOneRole(), toast_delete_datum(), toast_fetch_datum(), toast_fetch_datum_slice(), toast_get_valid_index(), toast_save_datum(), toastid_valueid_exists(), transientrel_startup(), tryAttachPartitionForeignKey(), TypeCreate(), typeInheritsFrom(), TypeShellMake(), update_attstats(), update_default_partition_oid(), update_relispartition(), updateAclDependenciesWorker(), UpdateIndexRelation(), UpdateSubscriptionRelState(), UpdateTwoPhaseState(), vac_truncate_clog(), vac_update_datfrozenxid(), vac_update_relstats(), validate_index(), validatePartitionedIndex(), and verify_heapam().

◆ table_openrv()

Relation table_openrv ( const RangeVar relation,
LOCKMODE  lockmode 
)

◆ table_openrv_extended()

Relation table_openrv_extended ( const RangeVar relation,
LOCKMODE  lockmode,
bool  missing_ok 
)

Definition at line 103 of file table.c.

105 {
106  Relation r;
107 
108  r = relation_openrv_extended(relation, lockmode, missing_ok);
109 
110  if (r)
112 
113  return r;
114 }
Relation relation_openrv_extended(const RangeVar *relation, LOCKMODE lockmode, bool missing_ok)
Definition: relation.c:172

References relation_openrv_extended(), and validate_relation_kind().

Referenced by get_object_address_relobject(), and parserOpenTable().

◆ try_table_open()

Relation try_table_open ( Oid  relationId,
LOCKMODE  lockmode 
)

Definition at line 60 of file table.c.

61 {
62  Relation r;
63 
64  r = try_relation_open(relationId, lockmode);
65 
66  /* leave if table does not exist */
67  if (!r)
68  return NULL;
69 
71 
72  return r;
73 }
Relation try_relation_open(Oid relationId, LOCKMODE lockmode)
Definition: relation.c:88

References try_relation_open(), and validate_relation_kind().

Referenced by expand_partitioned_rtentry(), logicalrep_rel_open(), reindex_index(), reindex_relation(), and ReindexRelationConcurrently().

◆ validate_relation_kind()

static void validate_relation_kind ( Relation  r)
inlinestatic

Definition at line 138 of file table.c.

139 {
140  if (r->rd_rel->relkind == RELKIND_INDEX ||
141  r->rd_rel->relkind == RELKIND_PARTITIONED_INDEX ||
142  r->rd_rel->relkind == RELKIND_COMPOSITE_TYPE)
143  ereport(ERROR,
144  (errcode(ERRCODE_WRONG_OBJECT_TYPE),
145  errmsg("cannot open relation \"%s\"",
148 }
int errcode(int sqlerrcode)
Definition: elog.c:853
int errmsg(const char *fmt,...)
Definition: elog.c:1070
#define ERROR
Definition: elog.h:39
#define ereport(elevel,...)
Definition: elog.h:149
int errdetail_relkind_not_supported(char relkind)
Definition: pg_class.c:24
#define RelationGetRelationName(relation)
Definition: rel.h:539
Form_pg_class rd_rel
Definition: rel.h:111

References ereport, errcode(), errdetail_relkind_not_supported(), errmsg(), ERROR, RelationData::rd_rel, and RelationGetRelationName.

Referenced by table_open(), table_openrv(), table_openrv_extended(), and try_table_open().