Re: no partition pruning when partitioning using array type

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: no partition pruning when partitioning using array type
Дата
Msg-id 20180710180555.mcryjqgvlrmwuxj6@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: no partition pruning when partitioning using array type  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: no partition pruning when partitioning using array type  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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.

Now if you don't have any values that violate the new constraint, then
the constraint can be created just fine, and you now have a partition
that can never accept any values.  But that doesn't seem like a terrible
problem.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: _isnan() on Windows
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: no partition pruning when partitioning using array type