Re: Getting ERROR: could not open file "base/13164/t3_16388" withpartition table with ON COMMIT

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Getting ERROR: could not open file "base/13164/t3_16388" withpartition table with ON COMMIT
Дата
Msg-id 20181102052715.GW1727@paquier.xyz
обсуждение исходный текст
Ответ на Re: Getting ERROR: could not open file "base/13164/t3_16388" withpartition table with ON COMMIT  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Getting ERROR: could not open file "base/13164/t3_16388" withpartition table with ON COMMIT  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Список pgsql-hackers
On Fri, Nov 02, 2018 at 02:18:04PM +0900, Michael Paquier wrote:
> This case is funky.  The parent gets dropped at commit time, but it does
> not know that it should drop the child as well per their dependencies.
> This actually goes into the internals of performDeletion(), which is
> scary to touch on back-branches just for such cases..

A bit more fun with inheritance:
=# begin;
BEGIN
=# create temp table aa_p (a int) on commit drop;
CREATE TABLE
=# create temp table aa_c (a int) inherits (aa_p) on commit delete rows;
NOTICE:  00000: merging column "a" with inherited definition
LOCATION:  MergeAttributes, tablecmds.c:2339
CREATE TABLE
=# insert into aa_p values (1);
INSERT 0 1
=# insert into aa_c values (1);
INSERT 0 1
=# commit;
NOTICE:  00000: drop cascades to table aa_c
LOCATION:  reportDependentObjects, dependency.c:995
ERROR:  XX000: could not open relation with OID 16426
LOCATION:  relation_open, heapam.c:1138

Let's treat that as a separate issue, as this happens also with an
unpatched build.  The only reason why you cannot trigger it with
partitions is that ON COMMIT is currently broken for them, so we should
fix the reported case first.  In consequence, I would tend to commit the
patch proposed and take care of the first, except if of course anybody
has an objection.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Getting ERROR: could not open file "base/13164/t3_16388" withpartition table with ON COMMIT
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: COPY FROM WHEN condition