24 #include "utils/fmgrprotos.h"
48 if (!relispartition && !RELKIND_HAS_PARTITIONS(relkind))
65 #define PG_PARTITION_TREE_COLS 4
92 elog(
ERROR,
"return type must be a row type");
126 if (ancestors !=
NIL)
137 if (relid != rootrelid)
139 foreach(lc, ancestors)
181 if (ancestors ==
NIL)
static Datum values[MAXATTR]
#define OidIsValid(objectId)
elog(ERROR, "%s: %s", p2, msg)
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, Datum *values, bool *isnull)
if(TABLE==NULL||TABLE_index==NULL)
Assert(fmt[strlen(fmt) - 1] !='\n')
void list_free(List *list)
List * lcons_oid(Oid datum, List *list)
bool get_rel_relispartition(Oid relid)
char get_rel_relkind(Oid relid)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
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)
MemoryContext multi_call_memory_ctx
#define SearchSysCacheExists1(cacheId, key1)