ON COMMIT actions and inheritance

Поиск
Список
Период
Сортировка
От Amit Langote
Тема ON COMMIT actions and inheritance
Дата
Msg-id 68f17907-ec98-1192-f99f-8011400517f5@lab.ntt.co.jp
обсуждение исходный текст
Ответы Re: ON COMMIT actions and inheritance  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Hi,

Michael pointed out a problem with specifying different ON COMMIT actions
on a temporary inheritance parent and its children:

https://www.postgresql.org/message-id/20181102051804.GV1727%40paquier.xyz

The problem is that when PreCommit_on_commit_actions() executes an ON
COMMIT DROP action on the parent, it will drop its children as well.  It
doesn't however remove the children's own actions, especially ON COMMIT
DELETE ROWS, from the list and when it gets around to executing them, the
children are already gone.  That causes the heap_open in heap_truncate to
fail with an error like this:

ERROR:  XX000: could not open relation with OID 16420
LOCATION:  relation_open, heapam.c:1138

One way to fix that is to remove the tables that no longer exist from the
list that's passed to heap_truncate(), which the attached patch implements.

Thanks,
Amit

Вложения

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

Предыдущее
От: Rajkumar Raghuwanshi
Дата:
Сообщение: Re: Getting ERROR: could not open file "base/13164/t3_16388" withpartition table with ON COMMIT
Следующее
От: Corey Huinker
Дата:
Сообщение: Re: partitioned tables referenced by FKs