PostgreSQL Source Code git master
|
#include "postgres.h"
#include <fcntl.h>
#include <unistd.h>
#include "access/genam.h"
#include "access/htup_details.h"
#include "access/table.h"
#include "access/transam.h"
#include "catalog/catalog.h"
#include "catalog/namespace.h"
#include "catalog/pg_auth_members.h"
#include "catalog/pg_authid.h"
#include "catalog/pg_database.h"
#include "catalog/pg_db_role_setting.h"
#include "catalog/pg_largeobject.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_parameter_acl.h"
#include "catalog/pg_replication_origin.h"
#include "catalog/pg_shdepend.h"
#include "catalog/pg_shdescription.h"
#include "catalog/pg_shseclabel.h"
#include "catalog/pg_subscription.h"
#include "catalog/pg_tablespace.h"
#include "catalog/pg_type.h"
#include "miscadmin.h"
#include "utils/fmgroids.h"
#include "utils/fmgrprotos.h"
#include "utils/rel.h"
#include "utils/snapmgr.h"
#include "utils/syscache.h"
Go to the source code of this file.
Macros | |
#define | GETNEWOID_LOG_THRESHOLD 1000000 |
#define | GETNEWOID_LOG_MAX_INTERVAL 128000000 |
Functions | |
bool | IsSystemRelation (Relation relation) |
bool | IsSystemClass (Oid relid, Form_pg_class reltuple) |
bool | IsCatalogRelation (Relation relation) |
bool | IsCatalogRelationOid (Oid relid) |
bool | IsInplaceUpdateRelation (Relation relation) |
bool | IsInplaceUpdateOid (Oid relid) |
bool | IsToastRelation (Relation relation) |
bool | IsToastClass (Form_pg_class reltuple) |
bool | IsCatalogNamespace (Oid namespaceId) |
bool | IsToastNamespace (Oid namespaceId) |
bool | IsReservedName (const char *name) |
bool | IsSharedRelation (Oid relationId) |
bool | IsPinnedObject (Oid classId, Oid objectId) |
Oid | GetNewOidWithIndex (Relation relation, Oid indexId, AttrNumber oidcolumn) |
RelFileNumber | GetNewRelFileNumber (Oid reltablespace, Relation pg_class, char relpersistence) |
Datum | pg_nextoid (PG_FUNCTION_ARGS) |
Datum | pg_stop_making_pinned_objects (PG_FUNCTION_ARGS) |
Oid GetNewOidWithIndex | ( | Relation | relation, |
Oid | indexId, | ||
AttrNumber | oidcolumn | ||
) |
Definition at line 419 of file catalog.c.
References Assert, BTEqualStrategyNumber, CHECK_FOR_INTERRUPTS, ereport, errdetail_plural(), errmsg(), errmsg_plural(), GetNewObjectId(), GETNEWOID_LOG_MAX_INTERVAL, GETNEWOID_LOG_THRESHOLD, HeapTupleIsValid, IsBinaryUpgrade, IsBootstrapProcessingMode, IsSystemRelation(), sort-test::key, LOG, ObjectIdGetDatum(), RelationGetRelationName, RelationGetRelid, ScanKeyInit(), SnapshotAny, systable_beginscan(), systable_endscan(), and systable_getnext().
Referenced by AddEnumLabel(), AddRoleMems(), AssignTypeArrayOid(), AssignTypeMultirangeArrayOid(), AssignTypeMultirangeOid(), CastCreate(), CollationCreate(), ConversionCreate(), CreateAccessMethod(), CreateConstraintEntry(), createdb(), CreateForeignDataWrapper(), CreateForeignServer(), CreateOpFamily(), CreatePolicy(), CreateProceduralLanguage(), CreatePublication(), CreateRole(), CreateStatistics(), CreateSubscription(), CreateTableSpace(), CreateTransform(), CreateTriggerFiringOn(), CreateUserMapping(), DefineOpClass(), DefineTSConfiguration(), DefineTSDictionary(), DefineTSParser(), DefineTSTemplate(), EnumValuesCreate(), GetNewRelFileNumber(), insert_event_trigger_tuple(), InsertExtensionTuple(), InsertRule(), LargeObjectCreate(), NamespaceCreate(), OperatorCreate(), OperatorShellMake(), ParameterAclCreate(), pg_nextoid(), ProcedureCreate(), publication_add_relation(), publication_add_schema(), SetDefaultACL(), StoreAttrDefault(), storeOperators(), storeProcedures(), toast_save_datum(), TypeCreate(), and TypeShellMake().
RelFileNumber GetNewRelFileNumber | ( | Oid | reltablespace, |
Relation | pg_class, | ||
char | relpersistence | ||
) |
Definition at line 528 of file catalog.c.
References Assert, RelFileLocatorBackend::backend, CHECK_FOR_INTERRUPTS, RelFileLocator::dbOid, elog, ERROR, GetNewObjectId(), GetNewOidWithIndex(), INVALID_PROC_NUMBER, InvalidOid, InvalidRelFileNumber, IsBinaryUpgrade, RelFileLocatorBackend::locator, MAIN_FORKNUM, MyDatabaseId, MyDatabaseTableSpace, pfree(), ProcNumberForTempRelations, RelFileLocator::relNumber, relpath, and RelFileLocator::spcOid.
Referenced by ATExecSetTableSpace(), heap_create_with_catalog(), index_create(), and RelationSetNewRelfilenumber().
bool IsCatalogNamespace | ( | Oid | namespaceId | ) |
Definition at line 212 of file catalog.c.
Referenced by AlterTableMoveAll(), check_publication_add_schema(), heap_create(), and RelationBuildLocalRelation().
bool IsCatalogRelation | ( | Relation | relation | ) |
Definition at line 103 of file catalog.c.
References IsCatalogRelationOid(), and RelationGetRelid.
Referenced by CacheInvalidateHeapTupleCommon(), check_publication_add_relation(), ExecSimpleRelationUpdate(), GlobalVisHorizonKindForRel(), heap_index_delete_tuples(), heap_multi_insert(), index_create(), needs_toast_table(), read_stream_begin_impl(), RelationInitTableAccessMethod(), and transformOnConflictArbiter().
bool IsCatalogRelationOid | ( | Oid | relid | ) |
Definition at line 120 of file catalog.c.
References FirstUnpinnedObjectId.
Referenced by check_relation_privileges(), is_publishable_class(), IsCatalogRelation(), IsSystemClass(), read_stream_begin_impl(), ReindexMultipleTables(), and ReindexRelationConcurrently().
bool IsInplaceUpdateOid | ( | Oid | relid | ) |
Definition at line 162 of file catalog.c.
Referenced by CatalogCacheCreateEntry(), and IsInplaceUpdateRelation().
bool IsInplaceUpdateRelation | ( | Relation | relation | ) |
Definition at line 152 of file catalog.c.
References IsInplaceUpdateOid(), and RelationGetRelid.
Referenced by CheckValidResultRel(), InitResultRelInfo(), and systable_inplace_update_begin().
Definition at line 341 of file catalog.c.
References FirstUnpinnedObjectId.
Referenced by checkSharedDependencies(), DropTableSpace(), findDependentObjects(), isObjectPinned(), recordSharedDependencyOn(), shdepChangeDep(), shdepDropOwned(), shdepReassignOwned(), typeDepNeeded(), and updateAclDependenciesWorker().
bool IsReservedName | ( | const char * | name | ) |
Definition at line 247 of file catalog.c.
References name.
Referenced by check_rolespec_name(), CreateRole(), CreateSchemaCommand(), CreateTableSpace(), pg_replication_origin_create(), RenameRole(), RenameSchema(), and RenameTableSpace().
bool IsSharedRelation | ( | Oid | relationId | ) |
Definition at line 273 of file catalog.c.
Referenced by CacheInvalidateCatalog(), CacheInvalidateHeapTupleCommon(), classIdGetDbId(), DeleteSecurityLabel(), get_object_address(), GetSecurityLabel(), pg_stat_reset_single_table_counters(), pgstat_fetch_stat_tabentry(), RelationBuildLocalRelation(), SetLocktagRelationOid(), SetSecurityLabel(), and UpdateLogicalMappings().
bool IsSystemClass | ( | Oid | relid, |
Form_pg_class | reltuple | ||
) |
Definition at line 85 of file catalog.c.
References IsCatalogRelationOid(), and IsToastClass().
Referenced by IsSystemRelation(), pg_class_aclmask_ext(), RangeVarCallbackForAlterRelation(), RangeVarCallbackForDropRelation(), RangeVarCallbackForPolicy(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RangeVarCallbackOwnsRelation(), ReindexMultipleTables(), renameatt_check(), swap_relation_files(), and truncate_check_rel().
bool IsSystemRelation | ( | Relation | relation | ) |
Definition at line 73 of file catalog.c.
References IsSystemClass(), RelationData::rd_rel, and RelationGetRelid.
Referenced by ATAddForeignKeyConstraint(), ATRewriteTables(), ATSimplePermissions(), CreateStatistics(), CreateTriggerFiringOn(), DefineQueryRewrite(), get_relation_info(), GetNewOidWithIndex(), heapam_index_build_range_scan(), heapam_relation_copy_for_cluster(), index_constraint_create(), index_create(), pg_nextoid(), rebuild_relation(), reindex_index(), ReindexRelationConcurrently(), RelationReloadIndexInfo(), RemovePolicyById(), RemoveRewriteRuleById(), RemoveTriggerById(), and systable_inplace_update_begin().
bool IsToastClass | ( | Form_pg_class | reltuple | ) |
Definition at line 195 of file catalog.c.
References IsToastNamespace().
Referenced by IsSystemClass().
bool IsToastNamespace | ( | Oid | namespaceId | ) |
Definition at line 230 of file catalog.c.
References isTempToastNamespace().
Referenced by AlterTableMoveAll(), check_publication_add_schema(), heap_create(), IsToastClass(), IsToastRelation(), reindex_index(), reindex_relation(), and ReindexRelationConcurrently().
bool IsToastRelation | ( | Relation | relation | ) |
Definition at line 175 of file catalog.c.
References IsToastNamespace(), and RelationGetNamespace.
Referenced by CacheInvalidateHeapTupleCommon(), heap_abort_speculative(), heap_insert(), ReorderBufferProcessTXN(), and ReorderBufferToastAppendChunk().
Datum pg_nextoid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 614 of file catalog.c.
References attname, ereport, errcode(), errmsg(), ERROR, GetNewOidWithIndex(), GETSTRUCT, HeapTupleIsValid, idx(), index_close(), index_open(), IndexRelationGetNumberOfKeyAttributes, IsSystemRelation(), NameStr, PG_GETARG_NAME, PG_GETARG_OID, PG_RETURN_OID, RelationGetRelationName, RelationGetRelid, ReleaseSysCache(), RowExclusiveLock, SearchSysCacheAttName(), superuser(), table_close(), and table_open().
Datum pg_stop_making_pinned_objects | ( | PG_FUNCTION_ARGS | ) |
Definition at line 693 of file catalog.c.
References ereport, errcode(), errmsg(), ERROR, PG_RETURN_VOID, StopGeneratingPinnedObjectIds(), and superuser().