From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: pointless check in RelationBuildPartitionDesc
Date: Tue, 4 Sep 2018 01:08:34 -0300
Message-ID: <20180904040834.vjmixztatyrqklp5@alvherre.pgsql> (raw)
In-Reply-To: <cf59a3e0-519c-dbb0-083e-db183137b893@lab.ntt.co.jp>
On 2018-Sep-04, Amit Langote wrote:
> On 2018/09/04 10:19, Michael Paquier wrote:
> > On Tue, Sep 04, 2018 at 09:47:07AM +0900, Amit Langote wrote:
> >> On 2018/09/04 6:39, Alvaro Herrera wrote:
> >>> After looking, it seems that this is just self-inflicted pain: for some
> >>> reason, we store the pg_inherits row for a partition, and immediately
> >>> afterwards compute and store its partition bound, which requires the
> >>> above hack. But if we do things in the opposite order, this is no
> >>> longer needed. I propose to remove it, as in the attached patch.
> >>
> >> +1. I remember having facepalmed at this before and had also written a
> >> patch but never got around to submitting it.
> >
> > Ok, I see. It seems to me that this could be replaced by an
> > elog(ERROR), as relispartition ought to be set anyway. This way any
> > future callers would get things done in the correct order.
>
> Converting it to elog(ERROR, ...) might be a good idea.
I think it'd be pointless noise. If we really want to protect against
that, I think we should promote the Assert for relpartbound's isnull
flag into an if test.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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: alvherre@2ndquadrant.com, Langote_Amit_f8@lab.ntt.co.jp, michael@paquier.xyz
Subject: Re: pointless check in RelationBuildPartitionDesc
In-Reply-To: <20180904040834.vjmixztatyrqklp5@alvherre.pgsql>
* 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