Re: Add pg_partition_root to get top-most parent of a partition tree - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Add pg_partition_root to get top-most parent of a partition tree
Date
Msg-id 20181212014825.GF17695@paquier.xyz
Whole thread Raw
In response to Re: Add pg_partition_root to get top-most parent of a partition tree  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Add pg_partition_root to get top-most parent of a partition tree  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
On Fri, Dec 07, 2018 at 11:46:05AM +0900, Michael Paquier wrote:
> On Thu, Dec 06, 2018 at 10:48:59PM -0300, Alvaro Herrera wrote:
>> I think adding a pg_partition_root() call to as many pg_partition_tree
>> tests as you modified is overkill ... OTOH I'd have one test that
>> invokes pg_partition_tree(pg_partition_root(some-partition)) to verify
>> that starting from any point in the tree you get the whole tree.
>
> Good idea, thanks for the input.

The recent commit cc53123 has fixed a couple of issues with
pg_partition_tree, so attached is a rebased patch which similarly makes
pg_partition_root return NULL for unsupported relkinds and undefined
relations.  I have also simplified the tests based on Alvaro's
suggestion to use pg_partition_tree(pg_partition_root(partfoo)).

Thanks,
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pg_partition_tree crashes for a non-defined relation
Next
From: Robert Haas
Date:
Subject: Re: Sketch of a fix for that truncation data corruption issue