Re: Partitioning with temp tables is broken - Mailing list pgsql-hackers

From Amit Langote
Subject Re: Partitioning with temp tables is broken
Date
Msg-id a2c209d3-0e47-3bc2-6e92-0fc049ec5cff@lab.ntt.co.jp
Whole thread Raw
In response to Re: Partitioning with temp tables is broken  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
List pgsql-hackers
On 2018/06/14 22:11, Ashutosh Bapat wrote:
> On Thu, Jun 14, 2018 at 9:42 AM, Amit Langote
>> I'm attaching a patch here to forbid adding a temporary table as partition
>> of permanent table.  I didn't however touch the feature that allows *all*
>> members in a partition tree to be temporary tables.
> 
> Similar problems will happen if a temporary partitioned table's
> hierarchy contains partitions from different sessions. Also, what
> should happen to the partitions from the other session after the
> session creating the temporary partitioned table goes away is not
> clear to me. Should they get dropped, how?
> 
> If I am reading Tom's reply upthread correctly, we should not allow
> creating a temporary partitioned table as well as temporary partitions
> altogether. I thought that that's easily fixable in grammar itself.
> But we allow creating a table in temporary schema. So that doesn't
> work. A better fix might be to prohibit those cases in
> DefineRelation() itself.

Sorry, I may not have described my patch sufficiently, but as mentioned in
my reply to Tom, it suffices to prohibit the cases which we don't handle
correctly, such as a mix of temporary and permanent tables and/or
temporary tables of different sessions appearing in a given partition tree.

Thanks,
Amit



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: BUG #15237: I got "ERROR: source for a multiple-column UPDATEitem must be a sub-SELECT or ROW() expression"
Next
From: David Rowley
Date:
Subject: Re: Partitioning with temp tables is broken