Re: pg_partition_tree crashes for a non-defined relation

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Stephen Frost <sfrost@snowman.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Postgres hackers <pgsql-hackers@postgresql.org>, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Date: 2018-12-10T13:52:37Z
Lists: pgsql-hackers
On Mon, Dec 10, 2018 at 08:21:43AM -0500, Stephen Frost wrote:
> * Michael Paquier (michael@paquier.xyz) wrote:
>> This still looks adapted to me.  Or would you reword it because "allow"
>> rather implies that an ERROR is returned?  Would you prefer changing it
>> something like that perhaps:
>> "Return NULL for relation types that do not appear in partition trees."
> 
> Yes.

OK.  Sure, let's do as you suggest then.  I'll wait a couple of days
before committing the patch so as if someone has extra comments they
have the time to post.  So please feel free to comment!
--
Michael

Commits

  1. Test partition functions with legacy inheritance children, too

  2. Consider only relations part of partition trees in partition functions

  3. Make pg_partition_tree return no rows on unsupported and undefined objects

  4. Tweak pg_partition_tree for undefined relations and unsupported relkinds