Re: no partition pruning when partitioning using array type

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: no partition pruning when partitioning using array type
Дата
Msg-id 39c7f34f-f888-ac78-a2bc-a741bddbc4c9@lab.ntt.co.jp
обсуждение исходный текст
Ответ на Re: no partition pruning when partitioning using array type  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: no partition pruning when partitioning using array type
Список pgsql-hackers
On 2018/07/11 13:12, Alvaro Herrera wrote:
> On 2018-Jul-11, Amit Langote wrote:
> 
>> What's the solution here then?  Prevent domains as partition key?
> 
> Maybe if a domain is used in a partition key somewhere, prevent
> constraints from being added?

Maybe, but I guess you mean only prevent adding such a constraint
after-the-fact.

If a domain has a constraint before creating any partitions based on the
domain, then partition creation command would check that the partition
bound values satisfy those constraints.

> Another thing worth considering: are you prevented from dropping a
> domain that's used in a partition key?  If not, you get an ugly message
> when you later try to drop the table.

Yeah, I was about to write a message about that.  I think we need to teach
RemoveAttributeById, which dependency.c calls when dropping the
referencing domain with cascade option, to abort if the attribute passed
to it belongs to the partition key of the input relation.

I tried that in the attached, but not sure about the order of messages
that appear in the output of DROP DOMAIN .. CASCADE.  It contains a NOTICE
message followed by an ERROR message.

Thanks,
Amit

Вложения

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

Предыдущее
От: Amit Khandekar
Дата:
Сообщение: Re: Concurrency bug in UPDATE of partition-key
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: patch to allow disable of WAL recycling