Re: Getting ERROR: could not open file "base/13164/t3_16388" withpartition table with ON COMMIT - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Getting ERROR: could not open file "base/13164/t3_16388" withpartition table with ON COMMIT
Date
Msg-id 20181105193725.4eluxe3xsewr65iu@alvherre.pgsql
Whole thread Raw
In response to 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>)
Responses 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>)
List pgsql-hackers
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.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: John Dent
Date:
Subject: Patch for Delta Materialized View Refreshes
Next
From: Tom Lane
Date:
Subject: Re: How to properly use the Executor interface?