Re: pg_partition_tree crashes for a non-defined relation - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pg_partition_tree crashes for a non-defined relation
Date
Msg-id 20190228014549.GD1617@paquier.xyz
Whole thread Raw
In response to Re: pg_partition_tree crashes for a non-defined relation  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: pg_partition_tree crashes for a non-defined relation
Re: pg_partition_tree crashes for a non-defined relation
List pgsql-hackers
On Wed, Feb 27, 2019 at 03:48:08PM -0300, Alvaro Herrera wrote:
> I just happened to come across the result of this rationale in
> pg_partition_tree() (an SRF) while developing a new related function,
> pg_partition_ancestors(), and find the resulting behavior rather absurd
> -- it returns one row with all NULL columns, rather than no rows.  I
> think the sensible behavior would be to do SRF_RETURN_DONE() before
> stashing any rows to the output, so that we get an empty result set
> instead.

Hmm.  Going through the thread again NULL was decided to make the
whole experience consistent, now by returning nothing we would get
a behavior as consistent as when NULL is used in input, so point taken
to tune the behavior for unsupported relkinds and undefined objects.

Does the attached look fine to you?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: "Tsunakawa, Takayuki"
Date:
Subject: RE: reloption to prevent VACUUM from truncating empty pages at theend of relation
Next
From: "Tsunakawa, Takayuki"
Date:
Subject: RE: Libpq support to connect to standby server as priority