23 #include "utils/fmgrprotos.h"
47 if (!relispartition && !RELKIND_HAS_PARTITIONS(relkind))
64 #define PG_PARTITION_TREE_COLS 4
91 elog(
ERROR,
"return type must be a row type");
125 if (ancestors !=
NIL)
136 if (relid != rootrelid)
138 foreach(lc, ancestors)
180 if (ancestors ==
NIL)
static Datum values[MAXATTR]
#define Assert(condition)
#define OidIsValid(objectId)
TypeFuncClass get_call_result_type(FunctionCallInfo fcinfo, Oid *resultTypeId, TupleDesc *resultTupleDesc)
#define SRF_IS_FIRSTCALL()
#define SRF_PERCALL_SETUP()
#define SRF_RETURN_NEXT(_funcctx, _result)
#define SRF_FIRSTCALL_INIT()
static Datum HeapTupleGetDatum(const HeapTupleData *tuple)
#define SRF_RETURN_DONE(_funcctx)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
if(TABLE==NULL||TABLE_index==NULL)
void list_free(List *list)
List * lcons_oid(Oid datum, List *list)
bool get_rel_relispartition(Oid relid)
char get_rel_relkind(Oid relid)
List * get_partition_ancestors(Oid relid)
Datum pg_partition_tree(PG_FUNCTION_ARGS)
#define PG_PARTITION_TREE_COLS
Datum pg_partition_root(PG_FUNCTION_ARGS)
static bool check_rel_can_be_partition(Oid relid)
Datum pg_partition_ancestors(PG_FUNCTION_ARGS)
List * find_all_inheritors(Oid parentrelId, LOCKMODE lockmode, List **numparents)
static int list_length(const List *l)
static Oid list_nth_oid(const List *list, int n)
static Datum BoolGetDatum(bool X)
static Datum ObjectIdGetDatum(Oid X)
static Datum Int32GetDatum(int32 X)
MemoryContextSwitchTo(old_ctx)
MemoryContext multi_call_memory_ctx
#define SearchSysCacheExists1(cacheId, key1)