30 #include "utils/fmgroids.h" 60 elog(
ERROR,
"could not find tuple for parent of relation %u", relid);
81 Anum_pg_inherits_inhrelid,
85 Anum_pg_inherits_inhseqno,
96 result = form->inhparent;
167 elog(
ERROR,
"cache lookup failed for relation %u", partIdx);
169 ispartition = classForm->relispartition;
203 bool *found_whole_row)
205 bool my_found_whole_row =
false;
218 &my_found_whole_row);
222 *found_whole_row = my_found_whole_row;
246 if (attnums == NULL || rel->
rd_rel->relkind != RELKIND_PARTITIONED_TABLE)
254 for (i = 0; i < partnatts; i++)
264 *used_in_expr =
false;
276 partexprs_item =
lnext(partexprs, partexprs_item);
281 *used_in_expr =
true;
310 defaultPartId = part_table_form->partdefid;
314 return defaultPartId;
334 elog(
ERROR,
"cache lookup failed for partition key of relation %u",
338 part_table_form->partdefid = defaultPartId;
355 Expr *defPartConstraint;
371 (
Node *) defPartConstraint);
Oid index_get_partition(Relation partition, Oid indexId)
void table_close(Relation relation, LOCKMODE lockmode)
void systable_endscan(SysScanDesc sysscan)
static Oid get_partition_parent_worker(Relation inhRel, Oid relid)
static ListCell * lnext(const List *l, const ListCell *c)
#define RelationGetDescr(relation)
#define RelationGetForm(relation)
void update_default_partition_oid(Oid parentId, Oid defaultPartId)
static int get_partition_natts(PartitionKey key)
Node * eval_const_expressions(PlannerInfo *root, Node *node)
#define FirstLowInvalidHeapAttributeNumber
void heap_freetuple(HeapTuple htup)
FormData_pg_partitioned_table * Form_pg_partitioned_table
List * lappend_oid(List *list, Oid datum)
#define OidIsValid(objectId)
SysScanDesc systable_beginscan(Relation heapRelation, Oid indexId, bool indexOK, Snapshot snapshot, int nkeys, ScanKey key)
void pull_varattnos(Node *node, Index varno, Bitmapset **varattnos)
Expr * makeBoolExpr(BoolExprType boolop, List *args, int location)
static List * get_partition_exprs(PartitionKey key)
HeapTuple systable_getnext(SysScanDesc sysscan)
List * map_partition_varattnos(List *expr, int fromrel_varno, Relation to_rel, Relation from_rel, bool *found_whole_row)
#define ObjectIdGetDatum(X)
Oid get_partition_parent(Oid relid)
bool has_partition_attrs(Relation rel, Bitmapset *attnums, bool *used_in_expr)
List * get_proposed_default_constraint(List *new_part_constraints)
Expr * canonicalize_qual(Expr *qual, bool is_check)
static ListCell * list_head(const List *l)
Node * map_variable_attnos(Node *node, int target_varno, int sublevels_up, const AttrNumber *attno_map, int map_length, Oid to_rowtype, bool *found_whole_row)
Oid get_default_partition_oid(Oid parentId)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
static int16 get_partition_col_attnum(PartitionKey key, int col)
void ReleaseSysCache(HeapTuple tuple)
Expr * make_ands_explicit(List *andclauses)
List * make_ands_implicit(Expr *clause)
#define HeapTupleIsValid(tuple)
#define InheritsRelidSeqnoIndexId
void CatalogTupleUpdate(Relation heapRel, ItemPointer otid, HeapTuple tup)
FormData_pg_inherits * Form_pg_inherits
List * RelationGetIndexList(Relation relation)
#define RelationGetPartitionKey(relation)
bool bms_overlap(const Bitmapset *a, const Bitmapset *b)
FormData_pg_class * Form_pg_class
#define SearchSysCacheCopy1(cacheId, key1)
void list_free(List *list)
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
Relation table_open(Oid relationId, LOCKMODE lockmode)
AttrNumber * convert_tuples_by_name_map(TupleDesc indesc, TupleDesc outdesc)
List * get_partition_ancestors(Oid relid)
bool bms_is_member(int x, const Bitmapset *a)
static void get_partition_ancestors_worker(Relation inhRel, Oid relid, List **ancestors)
#define BTEqualStrategyNumber