27 #include "utils/fmgroids.h" 66 if (rel->
rd_rel->relkind != RELKIND_PARTITIONED_TABLE)
120 is_leaf = (
bool *)
palloc(nparts *
sizeof(
bool));
126 foreach(cell, inhoids)
140 Anum_pg_class_relpartbound,
161 if (boundspec == NULL)
187 elog(
ERROR,
"missing relpartbound for relation %u", inhrelid);
189 elog(
ERROR,
"invalid relpartbound for relation %u", inhrelid);
201 if (partdefid != inhrelid)
202 elog(
ERROR,
"expected partdefid %u, but got %u",
203 inhrelid, partdefid);
209 boundspecs[
i] = boundspec;
226 "partition descriptor",
233 partdesc->
nparts = nparts;
249 for (i = 0; i < nparts; i++)
253 partdesc->
oids[index] = oids[
i];
254 partdesc->
is_leaf[index] = is_leaf[
i];
#define IsA(nodeptr, _type_)
#define AllocSetContextCreate
void table_close(Relation relation, LOCKMODE lockmode)
void systable_endscan(SysScanDesc sysscan)
#define RelationGetDescr(relation)
void MemoryContextSetParent(MemoryContext context, MemoryContext new_parent)
char get_rel_relkind(Oid relid)
#define ALLOCSET_SMALL_SIZES
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
PartitionDirectory CreatePartitionDirectory(MemoryContext mcxt)
MemoryContext CurTransactionContext
void * stringToNode(const char *str)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
PartitionKey RelationGetPartitionKey(Relation rel)
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
PartitionBoundInfo boundinfo
HeapTuple systable_getnext(SysScanDesc sysscan)
void RelationDecrementReferenceCount(Relation rel)
#define ObjectIdGetDatum(X)
void DestroyPartitionDirectory(PartitionDirectory pdir)
#define MemoryContextCopyAndSetIdentifier(cxt, id)
PartitionDesc RelationGetPartitionDesc(Relation rel)
#define RelationGetRelationName(relation)
#define partition_bound_has_default(bi)
HTAB * hash_create(const char *tabname, long nelem, const HASHCTL *info, int flags)
PartitionDesc rd_partdesc
struct PartitionDirectoryEntry PartitionDirectoryEntry
Oid get_default_partition_oid(Oid parentId)
#define heap_getattr(tup, attnum, tupleDesc, isnull)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
#define TextDatumGetCString(d)
PartitionBoundInfo partition_bounds_copy(PartitionBoundInfo src, PartitionKey key)
static void RelationBuildPartitionDesc(Relation rel)
void RelationIncrementReferenceCount(Relation rel)
void ReleaseSysCache(HeapTuple tuple)
Datum SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
void * MemoryContextAllocZero(MemoryContext context, Size size)
List * find_inheritance_children(Oid parentrelId, LOCKMODE lockmode)
#define HeapTupleIsValid(tuple)
#define Assert(condition)
static int list_length(const List *l)
void * hash_seq_search(HASH_SEQ_STATUS *status)
void hash_seq_init(HASH_SEQ_STATUS *status, HTAB *hashp)
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
PartitionDesc PartitionDirectoryLookup(PartitionDirectory pdir, Relation rel)
static void static void status(const char *fmt,...) pg_attribute_printf(1
Relation table_open(Oid relationId, LOCKMODE lockmode)
#define RelationGetRelid(relation)
PartitionBoundInfo partition_bounds_create(PartitionBoundSpec **boundspecs, int nparts, PartitionKey key, int **mapping)
#define BTEqualStrategyNumber
struct PartitionDirectoryData PartitionDirectoryData
MemoryContext CacheMemoryContext
Oid get_default_oid_from_partdesc(PartitionDesc partdesc)