Re: pg_partition_tree crashes for a non-defined relation

Stephen Frost <sfrost@snowman.net>

From: Stephen Frost <sfrost@snowman.net>
To: Michael Paquier <michael@paquier.xyz>
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:21:43Z
Lists: pgsql-hackers
Greetings,

* Michael Paquier (michael@paquier.xyz) wrote:
> On Sun, Dec 09, 2018 at 12:49:18PM -0500, Stephen Frost wrote:
> > Looks alright on a quick glance, but shouldn't you also update the
> > comment..?
> 
> The comment on HEAD or with the patch is that:
>     /* Only allow relation types that can appear in partition trees. */
> 
> 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.

Thanks!

Stephen

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