Partition Check not updated when insert into a partition

Поиск
Список
Период
Сортировка
От houzj.fnst@fujitsu.com
Тема Partition Check not updated when insert into a partition
Дата
Msg-id OS3PR01MB5718DA1C4609A25186D1FBF194089@OS3PR01MB5718.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответы RE: Partition Check not updated when insert into a partition  ("houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>)
Re: Partition Check not updated when insert into a partition  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
Hi,

When directly INSERT INTO partition, postgres will invoke ExecPartitionCheck
which will execute its parent's and grandparent's partition constraint check.
From the code, the whole constraint check is saved in relcache::rd_partcheck.

For a multi-level partition, for example: table 'A' is partition of table
'B', and 'B' is also partition of table 'C'. After I 'ALTER TABLE C DETACH B',
I thought partition constraint check of table 'C' does not matter anymore if
INSERT INTO table 'A'. But it looks like the relcache of 'A' is not invalidated
after detaching 'B'. And the relcache::rd_partcheck still include the partition
constraint of table 'C'. Note If I invalidate the table 'A''s relcache manually,
then next time the relcache::rd_partcheck will be updated to the expected
one which does not include partition constraint check of table 'C'.
(ATTACH partition has the same behaviour that relcache::rd_partcheck will
not be updated immediately)

Does it work as expected ? I didn't find some explanation from the doc.
(sorry if I missed something).

Best regards,
houzj



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Doc chapter for Hash Indexes
Следующее
От: Gurjeet Singh
Дата:
Сообщение: Automatic notification for top transaction IDs