25 #include "utils/fmgroids.h"
73 Assert(rel->
rd_rel->relkind == RELKIND_PARTITIONED_TABLE);
141 bool *is_leaf = NULL;
148 bool retried =
false;
162 detached_exist =
false;
175 is_leaf = (
bool *)
palloc(nparts *
sizeof(
bool));
181 foreach(cell, inhoids)
195 Anum_pg_class_relpartbound,
225 if (boundspec == NULL)
270 if (!boundspec && !retried)
280 elog(
ERROR,
"missing relpartbound for relation %u", inhrelid);
282 elog(
ERROR,
"invalid relpartbound for relation %u", inhrelid);
294 if (partdefid != inhrelid)
295 elog(
ERROR,
"expected partdefid %u, but got %u",
296 inhrelid, partdefid);
302 boundspecs[
i] = boundspec;
319 "partition descriptor",
326 partdesc->
nparts = nparts;
349 for (
i = 0;
i < nparts;
i++)
432 ctl.keysize =
sizeof(
Oid);
#define TextDatumGetCString(d)
#define Assert(condition)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
HTAB * hash_create(const char *tabname, long nelem, const HASHCTL *info, int flags)
void * hash_seq_search(HASH_SEQ_STATUS *status)
void hash_seq_init(HASH_SEQ_STATUS *status, HTAB *hashp)
void systable_endscan(SysScanDesc sysscan)
HeapTuple systable_getnext(SysScanDesc sysscan)
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
#define HeapTupleIsValid(tuple)
static Datum heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
void AcceptInvalidationMessages(void)
char get_rel_relkind(Oid relid)
void MemoryContextSetParent(MemoryContext context, MemoryContext new_parent)
void * MemoryContextAllocZero(MemoryContext context, Size size)
MemoryContext CurTransactionContext
MemoryContext CacheMemoryContext
#define AllocSetContextCreate
#define ALLOCSET_SMALL_SIZES
#define MemoryContextCopyAndSetIdentifier(cxt, id)
#define IsA(nodeptr, _type_)
PartitionBoundInfo partition_bounds_create(PartitionBoundSpec **boundspecs, int nparts, PartitionKey key, int **mapping)
PartitionBoundInfo partition_bounds_copy(PartitionBoundInfo src, PartitionKey key)
#define partition_bound_has_default(bi)
PartitionKey RelationGetPartitionKey(Relation rel)
PartitionDirectory CreatePartitionDirectory(MemoryContext mcxt, bool omit_detached)
void DestroyPartitionDirectory(PartitionDirectory pdir)
PartitionDesc PartitionDirectoryLookup(PartitionDirectory pdir, Relation rel)
PartitionDesc RelationGetPartitionDesc(Relation rel, bool omit_detached)
static PartitionDesc RelationBuildPartitionDesc(Relation rel, bool omit_detached)
Oid get_default_oid_from_partdesc(PartitionDesc partdesc)
struct PartitionDirectoryEntry PartitionDirectoryEntry
struct PartitionDirectoryData PartitionDirectoryData
Oid get_default_partition_oid(Oid parentId)
List * find_inheritance_children_extended(Oid parentrelId, bool omit_detached, LOCKMODE lockmode, bool *detached_exist, TransactionId *detached_xmin)
static int list_length(const List *l)
static Datum ObjectIdGetDatum(Oid X)
MemoryContextSwitchTo(old_ctx)
void * stringToNode(const char *str)
#define RelationGetRelid(relation)
#define RelationGetDescr(relation)
#define RelationGetRelationName(relation)
void RelationDecrementReferenceCount(Relation rel)
void RelationIncrementReferenceCount(Relation rel)
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
bool XidInMVCCSnapshot(TransactionId xid, Snapshot snapshot)
bool ActiveSnapshotSet(void)
Snapshot GetActiveSnapshot(void)
#define BTEqualStrategyNumber
int last_found_datum_index
PartitionBoundInfo boundinfo
int last_found_part_index
TransactionId rd_partdesc_nodetached_xmin
PartitionDesc rd_partdesc
PartitionDesc rd_partdesc_nodetached
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
#define InvalidTransactionId
#define TransactionIdIsValid(xid)