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

From Michael Paquier
Subject Re: Partitioning with temp tables is broken
Date
Msg-id 20180619105241.GA1548@paquier.xyz
Whole thread Raw
In response to Re: Partitioning with temp tables is broken  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Responses Re: Partitioning with temp tables is broken
List pgsql-hackers
On Tue, Jun 19, 2018 at 02:50:44PM +0530, Ashutosh Bapat wrote:
> +
> +     <listitem>
> +      <para>
> +       Mixing temporary and permanent relations in the same partition tree
> +       is not allowed.  Hence, if the root partitioned table is permanent,
>
> Do we want to mention "root" explicitly here?

Yes, let's use "partitioned table" here.  The docs also say so for
CREATE TABLE ... PARTITION BY.

> In general it looks like we could write the above paragraph as
> "A permanant partitioned table should have all its partitions
> permanant. A temporary partitioned table should have all its
> partitions temporary and should belong to the same session which
> temporary partitioned table belongs to."

I find the suggestion from Amit more elegant, still you are right that
mentioning that all temporary relations need to be from the same session
would be a good addition :)

I was under the impression that this was implied in the precious
phrasing but you guys visibly don't match with my impression.  So I
would suggest this paragraph at the end:
"Mixing temporary and permanent relations in the same partition tree is
not allowed.  Hence, if the partitioned table is permanent, so must be
its partitions at all levels and likewise if the partitioned table is
temporary.  When using temporary relations, all members of the partition
tree have to be from the same session."

> Looks like MergeAttributes() is doing more than just merging attributes. But
> that's not fault of this patch. It's been so for quite some time.

I also find that a bit depressing, but that's not work for v11 at this
stage.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: Postgres 11 release notes
Next
From: Ashutosh Bapat
Date:
Subject: Re: Partitioning with temp tables is broken