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