pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Tweak pg_partition_tree for undefined relations and unsupported
Date: Wed, 12 Dec 2018 00:51:09 +0000
Message-ID: <E1gWsk1-00076a-PI@gemulon.postgresql.org> (raw)

Tweak pg_partition_tree for undefined relations and unsupported relkinds

This fixes a crash which happened when calling the function directly
with a relation OID referring to a non-existing object, and changes the
behavior so as NULL is returned for unsupported relkinds instead of
generating an error.  This puts the new function in line with many other
system functions, and eases actions like full scans of pg_class.

Author: Michael Paquier
Reviewed-by: Amit Langote, Stephen Frost
Discussion: https://postgr.es/m/20181207010406.GO2407@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cc53123bcc9d8786acae2885c3a0897b7be34a02

Modified Files
--------------
src/backend/utils/adt/partitionfuncs.c       | 11 ++++++-----
src/test/regress/expected/partition_info.out | 18 ++++++++++++++++--
src/test/regress/sql/partition_info.sql      |  1 +
3 files changed, 23 insertions(+), 7 deletions(-)



Message-ID: <E1gWsk1-00076a-PI@gemulon.postgresql.org>
Permalink:  ../E1gWsk1-00076a-PI@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gWsk1-00076a-PI@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Tweak pg_partition_tree for undefined relations and unsupported
  In-Reply-To: <E1gWsk1-00076a-PI@gemulon.postgresql.org>
  References: <E1gWsk1-00076a-PI@gemulon.postgresql.org>

* 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