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

2018-11-05 Thread Amit Langote
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

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

2018-11-05 Thread Michael Paquier
On Mon, Nov 05, 2018 at 04:37:25PM -0300, Alvaro Herrera wrote: > 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. Yes, using a relkind

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

2018-11-05 Thread Alvaro Herrera
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

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

2018-11-04 Thread Rajkumar Raghuwanshi
On Mon, Nov 5, 2018 at 5:49 AM Michael Paquier wrote: > On Fri, Nov 02, 2018 at 04:39:07PM +0900, Amit Langote wrote: > > Agreed that they're two independent issues, although it wouldn't be such > a > > bad idea to fix them in one go, as they're both issues related to the > > handling of ON

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

2018-11-04 Thread Amit Langote
On 2018/11/05 9:19, Michael Paquier wrote: > On Fri, Nov 02, 2018 at 04:39:07PM +0900, Amit Langote wrote: >> Agreed that they're two independent issues, although it wouldn't be such a >> bad idea to fix them in one go, as they're both issues related to the >> handling of ON COMMIT actions on

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

2018-11-04 Thread Michael Paquier
On Fri, Nov 02, 2018 at 04:39:07PM +0900, Amit Langote wrote: > Agreed that they're two independent issues, although it wouldn't be such a > bad idea to fix them in one go, as they're both issues related to the > handling of ON COMMIT actions on tables in inheritance trees. I have pushed 0001

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

2018-11-02 Thread Amit Langote
Hi, On 2018/11/02 14:27, Michael Paquier wrote: > On Fri, Nov 02, 2018 at 02:18:04PM +0900, Michael Paquier wrote: >> This case is funky. Interesting indeed. >> The parent gets dropped at commit time, but it does >> not know that it should drop the child as well per their dependencies. >> This

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

2018-11-01 Thread Michael Paquier
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

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

2018-11-01 Thread Michael Paquier
On Fri, Nov 02, 2018 at 01:36:05PM +0900, Amit Langote wrote: > When writing the test, I noticed something to be pointed out. As of > 1c7c317cd9d, partitions of a temporary partition table themselves must be > temporary, but the ON COMMIT action has to be specified for each table > separately.

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

2018-11-01 Thread Amit Langote
On 2018/11/02 10:51, Michael Paquier wrote: > On Thu, Nov 01, 2018 at 01:04:43PM +0900, Michael Paquier wrote: >> On Thu, Nov 01, 2018 at 12:39:16PM +0900, Amit Langote wrote: >>> Rajkumar pointed out off-list that the patch still remains to be applied. >>> Considering that there is a planned

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

2018-11-01 Thread Michael Paquier
On Thu, Nov 01, 2018 at 01:04:43PM +0900, Michael Paquier wrote: > On Thu, Nov 01, 2018 at 12:39:16PM +0900, Amit Langote wrote: >> Rajkumar pointed out off-list that the patch still remains to be applied. >> Considering that there is a planned point release on Nov 8, maybe we >> should do

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

2018-10-31 Thread Michael Paquier
On Thu, Nov 01, 2018 at 12:39:16PM +0900, Amit Langote wrote: > Rajkumar pointed out off-list that the patch still remains to be applied. > Considering that there is a planned point release on Nov 8, maybe we > should do something about this? Yes doing something about that very soon would be a

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

2018-10-31 Thread Amit Langote
On 2018/09/14 10:53, Amit Langote wrote: > On 2018/09/13 23:13, Tom Lane wrote: >> Amit Langote writes: >>> On 2018/09/13 1:14, Tom Lane wrote: That seems excessively restrictive. Anything that has storage (e.g. matviews) ought to be truncatable, no? >> >>> Not by heap_truncate it

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

2018-09-17 Thread Rajkumar Raghuwanshi
On Fri, Sep 14, 2018 at 7:23 AM, Amit Langote wrote: > On 2018/09/13 23:13, Tom Lane wrote: > > Amit Langote writes: > >> On 2018/09/13 1:14, Tom Lane wrote: > >>> That seems excessively restrictive. Anything that has storage (e.g. > >>> matviews) ought to be truncatable, no? > > > >> Not by

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

2018-09-13 Thread Amit Langote
On 2018/09/13 23:13, Tom Lane wrote: > Amit Langote writes: >> On 2018/09/13 1:14, Tom Lane wrote: >>> That seems excessively restrictive. Anything that has storage (e.g. >>> matviews) ought to be truncatable, no? > >> Not by heap_truncate it seems. The header comment of heap_truncate says >>

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

2018-09-13 Thread Tom Lane
Amit Langote writes: > On 2018/09/13 1:14, Tom Lane wrote: >> That seems excessively restrictive. Anything that has storage (e.g. >> matviews) ought to be truncatable, no? > Not by heap_truncate it seems. The header comment of heap_truncate says > that it concerns itself only with ON COMMIT

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

2018-09-12 Thread Amit Langote
On 2018/09/13 12:37, Michael Paquier wrote: > On Wed, Sep 12, 2018 at 12:14:00PM -0400, Tom Lane wrote: >> I thought we had a macro or utility function somewhere that knew which >> relkinds have storage, though I can't find it right now. I'd be >> inclined to instantiate that if it doesn't exist,

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

2018-09-12 Thread Amit Langote
On 2018/09/13 1:14, Tom Lane wrote: > Amit Langote writes: >> The infamous missing-relkind-check in heap_truncate() seems to be behind >> this. Perhaps, a patch like the attached will do? > > That seems excessively restrictive. Anything that has storage (e.g. > matviews) ought to be

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

2018-09-12 Thread Michael Paquier
On Wed, Sep 12, 2018 at 12:14:00PM -0400, Tom Lane wrote: > I thought we had a macro or utility function somewhere that knew which > relkinds have storage, though I can't find it right now. I'd be > inclined to instantiate that if it doesn't exist, and then the code > here ought to read something

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

2018-09-12 Thread Tom Lane
Amit Langote writes: > The infamous missing-relkind-check in heap_truncate() seems to be behind > this. Perhaps, a patch like the attached will do? That seems excessively restrictive. Anything that has storage (e.g. matviews) ought to be truncatable, no? I thought we had a macro or utility

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

2018-09-12 Thread Amit Langote
On 2018/09/12 19:29, Rajkumar Raghuwanshi wrote: > Hi, > > I am getting below error while creating temp root partition table with on > commit. getting same error from v10 onwards. > > [edb@localhost bin]$ ./psql postgres > psql (10.5) > Type "help" for help. > > postgres=# CREATE TEMP TABLE

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

2018-09-12 Thread Rajkumar Raghuwanshi
Hi, I am getting below error while creating temp root partition table with on commit. getting same error from v10 onwards. [edb@localhost bin]$ ./psql postgres psql (10.5) Type "help" for help. postgres=# CREATE TEMP TABLE test ( c1 varchar, c2 int) PARTITION BY RANGE (c1) ON COMMIT DELETE