Add pg_partition_root to display top-most parent of a partition tree

Enterprise / PostgreSQL - Michael Paquier [paquier.xyz] - 7 February 2019 23:56 EST

This is useful when looking at partition trees with multiple layers, and combined with pg_partition_tree, it provides the possibility to show up an entire tree by just knowing one member at any level.

Author: Michael Paquier

3677a0b26b Add pg_partition_root to display top-most parent of a partition tree
doc/src/sgml/func.sgml | 11 ++++
src/backend/utils/adt/partitionfuncs.c | 75 ++++++++++++++++++++++++----
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.dat | 5 ++
src/test/regress/expected/partition_info.out | 58 +++++++++++++++++++++
src/test/regress/sql/partition_info.sql | 13 +++++
6 files changed, 153 insertions(+), 11 deletions(-)

Upstream: git.postgresql.org


  • Share