PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/genam.h"
#include "access/htup_details.h"
#include "access/table.h"
#include "catalog/partition.h"
#include "catalog/pg_inherits.h"
#include "partitioning/partbounds.h"
#include "partitioning/partdesc.h"
#include "utils/builtins.h"
#include "utils/fmgroids.h"
#include "utils/hsearch.h"
#include "utils/inval.h"
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/partcache.h"
#include "utils/rel.h"
#include "utils/snapmgr.h"
#include "utils/syscache.h"
Go to the source code of this file.
Data Structures | |
struct | PartitionDirectoryData |
struct | PartitionDirectoryEntry |
Typedefs | |
typedef struct PartitionDirectoryData | PartitionDirectoryData |
typedef struct PartitionDirectoryEntry | PartitionDirectoryEntry |
Functions | |
static PartitionDesc | RelationBuildPartitionDesc (Relation rel, bool omit_detached) |
PartitionDesc | RelationGetPartitionDesc (Relation rel, bool omit_detached) |
PartitionDirectory | CreatePartitionDirectory (MemoryContext mcxt, bool omit_detached) |
PartitionDesc | PartitionDirectoryLookup (PartitionDirectory pdir, Relation rel) |
void | DestroyPartitionDirectory (PartitionDirectory pdir) |
Oid | get_default_oid_from_partdesc (PartitionDesc partdesc) |
typedef struct PartitionDirectoryData PartitionDirectoryData |
typedef struct PartitionDirectoryEntry PartitionDirectoryEntry |
PartitionDirectory CreatePartitionDirectory | ( | MemoryContext | mcxt, |
bool | omit_detached | ||
) |
Definition at line 423 of file partdesc.c.
References ctl, HASH_BLOBS, HASH_CONTEXT, hash_create(), HASH_ELEM, MemoryContextSwitchTo(), PartitionDirectoryData::omit_detached, palloc(), PartitionDirectoryData::pdir_hash, and PartitionDirectoryData::pdir_mcxt.
Referenced by CreatePartitionPruneState(), ExecInitPartitionDispatchInfo(), and set_relation_partition_info().
void DestroyPartitionDirectory | ( | PartitionDirectory | pdir | ) |
Definition at line 484 of file partdesc.c.
References hash_seq_init(), hash_seq_search(), PartitionDirectoryData::pdir_hash, PartitionDirectoryEntry::rel, and RelationDecrementReferenceCount().
Referenced by FreeExecutorState(), and standard_planner().
Oid get_default_oid_from_partdesc | ( | PartitionDesc | partdesc | ) |
Definition at line 501 of file partdesc.c.
References PartitionDescData::boundinfo, PartitionBoundInfoData::default_index, InvalidOid, PartitionDescData::oids, and partition_bound_has_default.
Referenced by ATExecAttachPartition(), ATExecDetachPartition(), DefineRelation(), and StorePartitionBound().
PartitionDesc PartitionDirectoryLookup | ( | PartitionDirectory | pdir, |
Relation | rel | ||
) |
Definition at line 456 of file partdesc.c.
References Assert, HASH_ENTER, hash_search(), PartitionDirectoryData::omit_detached, PartitionDirectoryEntry::pd, PartitionDirectoryData::pdir_hash, PartitionDirectoryEntry::rel, RelationGetPartitionDesc(), RelationGetRelid, and RelationIncrementReferenceCount().
Referenced by CreatePartitionPruneState(), ExecInitPartitionDispatchInfo(), expand_partitioned_rtentry(), and set_relation_partition_info().
|
static |
Definition at line 134 of file partdesc.c.
References AcceptInvalidationMessages(), AccessShareLock, ActiveSnapshotSet(), ALLOCSET_SMALL_SIZES, AllocSetContextCreate, Assert, PartitionDescData::boundinfo, BTEqualStrategyNumber, CacheMemoryContext, CurTransactionContext, PartitionDescData::detached_exist, elog, ERROR, find_inheritance_children_extended(), get_default_partition_oid(), get_rel_relkind(), heap_getattr(), HeapTupleIsValid, i, InvalidTransactionId, PartitionBoundSpec::is_default, PartitionDescData::is_leaf, IsA, sort-test::key, PartitionDescData::last_found_count, PartitionDescData::last_found_datum_index, PartitionDescData::last_found_part_index, lfirst_oid, list_length(), MemoryContextAllocZero(), MemoryContextCopyAndSetIdentifier, MemoryContextSetParent(), MemoryContextSwitchTo(), NoLock, PartitionDescData::nparts, ObjectIdGetDatum(), PartitionDescData::oids, palloc(), partition_bounds_copy(), partition_bounds_create(), RelationData::rd_partdesc, RelationData::rd_partdesc_nodetached, RelationData::rd_partdesc_nodetached_xmin, RelationData::rd_pdcxt, RelationData::rd_pddcxt, RelationGetDescr, RelationGetPartitionKey(), RelationGetRelationName, RelationGetRelid, ReleaseSysCache(), ScanKeyInit(), SearchSysCache1(), stringToNode(), SysCacheGetAttr(), systable_beginscan(), systable_endscan(), systable_getnext(), table_close(), table_open(), TextDatumGetCString, and TransactionIdIsValid.
Referenced by RelationGetPartitionDesc().
PartitionDesc RelationGetPartitionDesc | ( | Relation | rel, |
bool | omit_detached | ||
) |
Definition at line 71 of file partdesc.c.
References ActiveSnapshotSet(), Assert, PartitionDescData::detached_exist, GetActiveSnapshot(), likely, RelationData::rd_partdesc, RelationData::rd_partdesc_nodetached, RelationData::rd_partdesc_nodetached_xmin, RelationData::rd_rel, RelationBuildPartitionDesc(), TransactionIdIsValid, and XidInMVCCSnapshot().
Referenced by addFkRecurseReferenced(), addFkRecurseReferencing(), ATExecAttachPartition(), ATExecAttachPartitionIdx(), ATExecDetachPartition(), ATPrepDropNotNull(), check_new_partition_bound(), CreateTriggerFiringOn(), DefineIndex(), DefineRelation(), EnableDisableTrigger(), get_qual_for_list(), get_qual_for_range(), PartitionDirectoryLookup(), QueuePartitionConstraintValidation(), renametrig(), renametrig_partition(), StorePartitionBound(), and validatePartitionedIndex().