pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Michael Paquier <michael@paquier.xyz>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Postgres hackers <pgsql-hackers@postgresql.org>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Subject: Re: pg_partition_tree crashes for a non-defined relation
Date: Sat, 8 Dec 2018 08:46:08 -0500
Message-ID: <20181208134608.GY3415@tamriel.snowman.net> (raw)
In-Reply-To: <20181208065436.GC1989@paquier.xyz>
References: <20181207010406.GO2407@paquier.xyz>
	<20181207230540.GA12740@paquier.xyz>
	<6105.1544243612@sss.pgh.pa.us>
	<20181208065436.GC1989@paquier.xyz>

Greetings,

* Michael Paquier (michael@paquier.xyz) wrote:
> On Fri, Dec 07, 2018 at 11:33:32PM -0500, Tom Lane wrote:
> > How about cases where the relation OID exists but it's the wrong
> > kind of relation?
> 
> Such cases already return an error:
> =# create sequence popo;
> CREATE SEQUENCE
> =# select pg_partition_tree('popo');
> ERROR:  42809: "popo" is not a table, a foreign table, or an index
> LOCATION:  pg_partition_tree, partitionfuncs.c:54
> 
> I think that's a sensible choice, because it makes no sense to look for
> the inheritors of unsupported relkinds.  Perhaps you have a different
> view on the matter?

We should really have a more clearly defined policy around this, but my
recollection is that we often prefer to return NULL rather than throwing
an error for the convenience of people doing things like querying
pg_class using similar functions.

I wonder if we maybe should have a regression test for every such
function which just queries the catalog in a way to force the function
to be called for every relation defined in the regression tests, to
ensure that it doesn't segfault or throw an error..

Thanks!

Stephen

Attachments:

  [application/pgp-signature] signature.asc (818B, ../20181208134608.GY3415@tamriel.snowman.net/2-signature.asc)
  download

view thread (36+ messages)  latest in thread

Message-ID: <20181208134608.GY3415@tamriel.snowman.net>
Permalink:  ../20181208134608.GY3415@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20181208134608.GY3415@tamriel.snowman.net

 · 

reply

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: sfrost@snowman.net, michael@paquier.xyz, tgl@sss.pgh.pa.us, Langote_Amit_f8@lab.ntt.co.jp
  Subject: Re: pg_partition_tree crashes for a non-defined relation
  In-Reply-To: <20181208134608.GY3415@tamriel.snowman.net>

* 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