Re: using expression syntax for partition bounds

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: using expression syntax for partition bounds
Date: 2019-01-02 13:58:53
Message-ID: b4d4f811-1482-a2f5-240d-e75a087f0bc3@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 26/11/2018 05:58, Amit Langote wrote:
> On 2018/11/09 14:38, Amit Langote wrote:
>> Rebased due to change in addRangeTableEntryForRelation's API.
>
> Rebased again due to changes in psql's describe output for partitioned tables.

Review:

Is "partition bound" the right term? For list partitioning, it's not
really a bound. Maybe it's OK.

Keep the ordering of EXPR_KIND_PARTITION_BOUND in the various switch
statements consistent.

I don't see any treatment of non-immutable expressions. There is a test
case with a non-immutable cast that was removed, but that's all. There
was considerable discussion earlier in the thread on whether
non-immutable expressions should be allowed. I'm not sure what the
resolution was, but in any case there should be documentation and tests
of the outcome.

The collation handling might need another look. The following is
allowed without any diagnostic:

CREATE TABLE t2 (
a text COLLATE "POSIX"
) PARTITION BY RANGE (a);
CREATE TABLE t2a PARTITION OF t2 FOR VALUES FROM ('foo' COLLATE "C") TO
('xyz');

I think the correct behavior would be that an explicit collation in the
partition bound expression is an error.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message James Coleman 2019-01-02 13:59:13 Re: Using vim for developing porstres wiki article
Previous Message Kohei KaiGai 2019-01-02 13:34:04 Re: add_partial_path() may remove dominated path but still in use