Re: Partitioning with temp tables is broken
Amit Langote <langote_amit_f8@lab.ntt.co.jp>
From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: Michael Paquier <michael@paquier.xyz>, amul sul <sulamul@gmail.com>,
Tom Lane <tgl@sss.pgh.pa.us>,
David Rowley <david.rowley@2ndquadrant.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Robert Haas <robertmhaas@gmail.com>
Date: 2018-06-15T01:38:29Z
Lists: 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
Commits
-
Clarify use of temporary tables within partition trees
- 5862174ec78a 10.5 landed
- 1c7c317cd9d1 11.0 landed