From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Michael Paquier <michael@paquier.xyz>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: [Suspect SPAM] Re: pgsql: Add pg_partition_root to display top-most parent of a partition
Date: Fri, 22 Mar 2019 13:09:23 +0900
Message-ID: <06be11a6-fd8d-b68b-1b97-1bafb1d3185c@lab.ntt.co.jp> (raw)
In-Reply-To: <20190322035538.GO20192@paquier.xyz>
References: <E1grthW-00078n-Az@gemulon.postgresql.org>
<20190322032612.GA323@alvherre.pgsql>
<20190322035538.GO20192@paquier.xyz>
Hi,
On 2019/03/22 12:55, Michael Paquier wrote:
> On Fri, Mar 22, 2019 at 12:26:12AM -0300, Alvaro Herrera wrote:
>> I noticed days ago that if you call pg_partition_root on the topmost
>> partitioned table, the server crashes :-)
I thought we already fixed that last month, but that was pg_partition_tree().
> It's when you think that the thing is actually done that another issue
> pops up. The attached fixes the issue, I suggest to return the
> top-most parent as result if the input is the top-most parent itself.
> Returning NULL does not make sense as in this case the relation can be
> part of a partition tree.
Thanks for writing the patch.
/* Fetch the top-most parent */
ancestors = get_partition_ancestors(relid);
Maybe, the patch should update this comment to say "Fetch the list of
ancestors".
+
+ /*
+ * If the listed partition is already the top-most parent, just
+ * return itself.
+ */
What does "listed partition" mean? Maybe, you mean "If the input
relation..."? How about write this as:
If the input relation is itself the top-most parent, just return itself.
Regards,
Amit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: Langote_Amit_f8@lab.ntt.co.jp, michael@paquier.xyz, alvherre@2ndquadrant.com, pgsql-committers@lists.postgresql.org
Subject: Re: [Suspect SPAM] Re: pgsql: Add pg_partition_root to display top-most parent of a partition
In-Reply-To: <06be11a6-fd8d-b68b-1b97-1bafb1d3185c@lab.ntt.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox