From: | Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> |
---|---|
To: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
Cc: | Michael Paquier <michael(at)paquier(dot)xyz>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Getting ERROR: could not open file "base/13164/t3_16388" with partition table with ON COMMIT |
Date: | 2018-11-06 00:23:22 |
Message-ID: | c2600ebb-d17e-5721-c90f-55e4a3577d4d@lab.ntt.co.jp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 2018/11/06 4:37, Alvaro Herrera wrote:
> On 2018-Nov-02, Amit Langote wrote:
>
>> Well, performDeletion *does* drop the child, because when the parent is
>> dropped due to its ON COMMIT DROP action, it's done using:
>>
>> /*
>> * Since this is an automatic drop, rather than one
>> * directly initiated by the user, we pass the
>> * PERFORM_DELETION_INTERNAL flag.
>> */
>> performDeletion(&object,
>> DROP_CASCADE, PERFORM_DELETION_INTERNAL);
>>
>> Note the DROP_CASCADE, which means its children will be deleted as part of
>> this.
>
> I think this code should collect all the OIDs to be dropped, then use a
> single performMultipleDeletions() at the end, after the heap_truncate
> call is done. That seems better to me than a relkind check.
I've posted in a new thread about this:
* ON COMMIT actions and inheritance *
https://www.postgresql.org/message-id/68f17907-ec98-1192-f99f-8011400517f5%40lab.ntt.co.jp
I've to say that what you suggest seems to be a more elegant way to fix
this issue. My patch fixes it by reconstructing the oids_to_truncate list
by removing the OIDs of children that were dropped via the ON COMMIT DROP
action of the parent using a SearchSysCacheExists1 test.
Thanks,
Amit
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2018-11-06 00:24:57 | Re: Why do pg_upgrade's test use the serial schedule? |
Previous Message | Michael Paquier | 2018-11-06 00:20:26 | Re: Getting ERROR: could not open file "base/13164/t3_16388" with partition table with ON COMMIT |