PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "catalog/partition.h"
#include "catalog/pg_class.h"
#include "catalog/pg_inherits.h"
#include "funcapi.h"
#include "utils/fmgrprotos.h"
#include "utils/lsyscache.h"
#include "utils/syscache.h"
Go to the source code of this file.
Macros | |
#define | PG_PARTITION_TREE_COLS 4 |
Functions | |
static bool | check_rel_can_be_partition (Oid relid) |
Datum | pg_partition_tree (PG_FUNCTION_ARGS) |
Datum | pg_partition_root (PG_FUNCTION_ARGS) |
Datum | pg_partition_ancestors (PG_FUNCTION_ARGS) |
#define PG_PARTITION_TREE_COLS 4 |
|
static |
Definition at line 34 of file partitionfuncs.c.
References get_rel_relispartition(), get_rel_relkind(), ObjectIdGetDatum(), and SearchSysCacheExists1.
Referenced by pg_partition_ancestors(), pg_partition_root(), and pg_partition_tree().
Datum pg_partition_ancestors | ( | PG_FUNCTION_ARGS | ) |
Definition at line 201 of file partitionfuncs.c.
References FuncCallContext::call_cntr, check_rel_can_be_partition(), get_partition_ancestors(), if(), lcons_oid(), list_length(), list_nth_oid(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, ObjectIdGetDatum(), PG_GETARG_OID, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, and FuncCallContext::user_fctx.
Datum pg_partition_root | ( | PG_FUNCTION_ARGS | ) |
Definition at line 164 of file partitionfuncs.c.
References Assert, check_rel_can_be_partition(), get_partition_ancestors(), list_free(), llast_oid, NIL, OidIsValid, PG_GETARG_OID, PG_RETURN_NULL, and PG_RETURN_OID.
Datum pg_partition_tree | ( | PG_FUNCTION_ARGS | ) |
Definition at line 62 of file partitionfuncs.c.
References AccessShareLock, BoolGetDatum(), FuncCallContext::call_cntr, check_rel_can_be_partition(), elog, ERROR, find_all_inheritors(), get_call_result_type(), get_partition_ancestors(), get_rel_relkind(), heap_form_tuple(), HeapTupleGetDatum(), if(), Int32GetDatum(), InvalidOid, lfirst_oid, linitial_oid, list_length(), list_nth_oid(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, NIL, ObjectIdGetDatum(), OidIsValid, partitions, PG_GETARG_OID, PG_PARTITION_TREE_COLS, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, FuncCallContext::tuple_desc, TYPEFUNC_COMPOSITE, FuncCallContext::user_fctx, and values.