Re: no partition pruning when partitioning using array type - Mailing list pgsql-hackers

From Tom Lane
Subject Re: no partition pruning when partitioning using array type
Date
Msg-id 2652.1531247447@sss.pgh.pa.us
Whole thread Raw
In response to Re: no partition pruning when partitioning using array type  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: no partition pruning when partitioning using array type  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2018-Jul-09, Tom Lane wrote:
>> Suppose you did
>>
>> create domain overint as int;
>> create table pt (a overint) partition by range (a);
>> create table pt1 partition of pt for values from (0) to (100);
>>
>> and the system took it, and then you did
>>
>> alter domain overint add check (value > 100);
>>
>> What happens now?

> It scans the table to check whether any values violate that condition,
> and raises an error if they do:

> alvherre=# alter domain overint add check (value > 100);
> ERROR:  column "a" of table "ppt1" contains values that violate the new constraint

> This looks sensible behavior to me.

And what about those partition bound values?  They are now illegal
for the domain, so I would expect a dump/reload to fail, regardless
of whether there are any values in the table.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: no partition pruning when partitioning using array type
Next
From: Adrien Nayrat
Date:
Subject: Re: New GUC to sample log queries