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

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
Reviewed-by: Álvaro Herrera, Amit Langote
Discussion: https://postgr.es/m/20181207014015.GP2407@paquier.xyz
This commit is contained in:
Michael Paquier
2019-02-08 08:56:14 +09:00
parent 34ea1ab7fd
commit 3677a0b26b
6 changed files with 153 additions and 11 deletions

View File

@ -53,6 +53,6 @@
*/
/* yyyymmddN */
#define CATALOG_VERSION_NO 201902071
#define CATALOG_VERSION_NO 201902081
#endif

View File

@ -10509,4 +10509,9 @@
proargnames => '{rootrelid,relid,parentrelid,isleaf,level}',
prosrc => 'pg_partition_tree' },
# function to get the top-most partition root parent
{ oid => '3424', descr => 'get top-most partition root parent',
proname => 'pg_partition_root', prorettype => 'regclass',
proargtypes => 'regclass', prosrc => 'pg_partition_root' },
]