From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Postgres hackers <pgsql-hackers@postgresql.org>
Subject: Re: pg_partition_tree crashes for a non-defined relation
Date: Fri, 01 Mar 2019 11:38:20 -0500
Message-ID: <31090.1551458300@sss.pgh.pa.us> (raw)
In-Reply-To: <20190301075829.GE31098@paquier.xyz>
References: <20190228014549.GD1617@paquier.xyz>
<20190228193203.GA26151@alvherre.pgsql>
<20190301002204.GA1348@paquier.xyz>
<de05e459-0562-f113-e82f-2627bc736b1d@lab.ntt.co.jp>
<10305.1551415816@sss.pgh.pa.us>
<20190301075829.GE31098@paquier.xyz>
Michael Paquier <michael@paquier.xyz> writes:
> On Thu, Feb 28, 2019 at 11:50:16PM -0500, Tom Lane wrote:
>> But, having said that, we've learned that it's generally bad for
>> catalog-query functions to fail outright just because they're pointed
>> at the wrong kind of catalog object. So I think that what we want here
>> is for pg_partition_tree to return NULL or an empty set or some such
>> for a plain table, while its output for a childless partitioned table
>> should be visibly different from that. I'm not wedded to details
>> beyond that idea.
> Yep, that's the intention since cc53123. I won't come back to return
> an ERROR in any case. Here is what the patch gives for childless
> partitions FWIW:
> =# CREATE TABLE ptif_test (a int, b int) PARTITION BY range (a);
> CREATE TABLE
> =# SELECT * FROM pg_partition_tree('ptif_test');
> relid | parentrelid | isleaf | level
> -----------+-------------+--------+-------
> ptif_test | null | f | 0
> (1 row)
Right, while you'd get zero rows out for a non-partitioned table.
WFM.
regards, tom lane
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, Langote_Amit_f8@lab.ntt.co.jp, alvherre@2ndquadrant.com, sfrost@snowman.net
Subject: Re: pg_partition_tree crashes for a non-defined relation
In-Reply-To: <31090.1551458300@sss.pgh.pa.us>
* 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