Re: using expression syntax for partition bounds - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: using expression syntax for partition bounds
Date
Msg-id b4d4f811-1482-a2f5-240d-e75a087f0bc3@2ndquadrant.com
Whole thread Raw
In response to Re: using expression syntax for partition bounds  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: using expression syntax for partition bounds  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List 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


pgsql-hackers by date:

Previous
From: Kohei KaiGai
Date:
Subject: Re: add_partial_path() may remove dominated path but still in use
Next
From: James Coleman
Date:
Subject: Re: Using vim for developing porstres wiki article