Re: [COMMITTERS] pgsql: Use MINVALUE/MAXVALUE instead of UNBOUNDED for range partition b

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Use MINVALUE/MAXVALUE instead of UNBOUNDED for range partition b
Date: 2017-09-14 08:01:46
Message-ID: CAEZATCXn7XPgq6sSNBSFv=st6Y9AHzBpHKuwuAj76qOrUHyHDw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 14 September 2017 at 03:49, Noah Misch <noah(at)leadboat(dot)com> wrote:
> On Wed, Sep 13, 2017 at 12:06:40PM -0400, Robert Haas wrote:
>> OK, thanks. I still don't really like allowing this, but I can see
>> that compatibility with other systems has some value here, and if
>> nobody else is rejecting these cases, maybe we shouldn't either. So
>> I'll hold my nose and change my vote to canonicalizing rather than
>> rejecting outright.
>
> I vote for rejecting it. DDL compatibility is less valuable than other
> compatibility. The hypothetical affected application can change its DDL to
> placate PostgreSQL and use that modified DDL for all other databases, too.

So we have 3 options:

1. Do nothing, allowing and keeping any values after a MINVALUE/MAXVALUE.

2. Allow the such values, but canonicalise what we store.

3. Reject anything other than MINVALUE/MAXVALUE after MINVALUE/MAXVALUE.

My order of preference is still (1), (2) then (3) because:

- Compatibility.
- Less verbose / easier to type.
- We allow multiple syntaxes for equivalent constraints in other places,
without canonicalising what the user enters.
- Regarding Robert's coding argument, code in general should not be
looking at and basing decisions on any values it sees after a
MINVALUE/MAXVALUE. If it does, at the very least it's doing more work
than it needs to, and at worst, there's a potential bug there which
would be more readily exposed by allowing arbitrary values there. Code
that only worked because because of earlier canonicalisation would
strike me as being somewhat fragile.

However, it seems that there is a clear consensus towards (2) or (3)
and we have viable patches for each, although I'm not sure which of
those the consensus is really leaning towards.

Robert, since partitioning was originally your commit, and you know
the wider codebase better, I'm happy to go with whatever you decide.

Regards,
Dean

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Langote 2017-09-14 09:01:36 Re: Re: [COMMITTERS] pgsql: Use MINVALUE/MAXVALUE instead of UNBOUNDED for range partition b
Previous Message Dean Rasheed 2017-09-14 07:54:34 Re: Re: [COMMITTERS] pgsql: Use MINVALUE/MAXVALUE instead of UNBOUNDED for range partition b

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeevan Ladhe 2017-09-14 08:03:52 Re: Optimise default partition scanning while adding new partition
Previous Message Dean Rasheed 2017-09-14 07:54:34 Re: Re: [COMMITTERS] pgsql: Use MINVALUE/MAXVALUE instead of UNBOUNDED for range partition b