Re: pgsql: Clarify use of temporary tables within partition trees

2018-07-03 Thread Amit Langote
On 2018/07/03 17:31, Amit Langote wrote: > On 2018/07/03 16:05, Michael Paquier wrote: >> On Tue, Jul 03, 2018 at 03:49:44PM +0900, Amit Langote wrote: >>> I forgot that expand_partitioned_rtentry() will recursively call itself if >>> a partition is itself a partitioned table, in which case the abo

Re: pgsql: Clarify use of temporary tables within partition trees

2018-07-03 Thread Michael Paquier
On Tue, Jul 03, 2018 at 03:49:44PM +0900, Amit Langote wrote: > I forgot that expand_partitioned_rtentry() will recursively call itself if > a partition is itself a partitioned table, in which case the above > code helps. Actually look at the coverage reports: https://coverage.postgresql.org/src/b

Re: pgsql: Clarify use of temporary tables within partition trees

2018-07-02 Thread Amit Langote
Just realized something... On 2018/07/03 15:29, Amit Langote wrote: > Sorry for jumping in late here. I have a comment on the patch. > > + /* if there are no partitions then treat this as non-inheritance case. > */ > + if (partdesc->nparts == 0) > + { > + parentrte->inh

Re: pgsql: Clarify use of temporary tables within partition trees

2018-07-02 Thread Michael Paquier
On Tue, Jul 03, 2018 at 03:29:36PM +0900, Amit Langote wrote: > Why is this not near the beginning of expand_partitioned_rtentry()? > > Also, ISTM, this code would be unreachable because > expand_inherited_rtentry would not call here if the above if statement is > true, no? FWIW, I understood tha

Re: pgsql: Clarify use of temporary tables within partition trees

2018-07-02 Thread Amit Langote
On 2018/07/03 15:16, David Rowley wrote: > On 3 July 2018 at 18:11, Michael Paquier wrote: >> On Tue, Jul 03, 2018 at 06:00:46PM +1200, David Rowley wrote: >>> I think it should be backpatched to v11 and v10. Your original commit >>> went there too. I don't see any reason to do any different here

Re: pgsql: Clarify use of temporary tables within partition trees

2018-07-02 Thread David Rowley
On 3 July 2018 at 18:11, Michael Paquier wrote: > On Tue, Jul 03, 2018 at 06:00:46PM +1200, David Rowley wrote: >> I think it should be backpatched to v11 and v10. Your original commit >> went there too. I don't see any reason to do any different here than >> what you did with the original commit.

Re: pgsql: Clarify use of temporary tables within partition trees

2018-07-02 Thread Michael Paquier
On Tue, Jul 03, 2018 at 06:00:46PM +1200, David Rowley wrote: > Thanks for fixing it up. It looks fine apart from "Temporation" should > be "Temporary". Of course, thanks. > I think it should be backpatched to v11 and v10. Your original commit > went there too. I don't see any reason to do any di

Re: pgsql: Clarify use of temporary tables within partition trees

2018-07-02 Thread David Rowley
On 3 July 2018 at 16:55, Michael Paquier wrote: > Okay, the patch looks logically correct to me, I just tweaked the > comments as per the attached. I would also back-patch that down to v11 > to keep the code consistent with HEAD.. What do you think? Thanks for fixing it up. It looks fine apart

Re: pgsql: Clarify use of temporary tables within partition trees

2018-07-02 Thread Michael Paquier
On Tue, Jul 03, 2018 at 12:59:33PM +1200, David Rowley wrote: > On 3 July 2018 at 10:16, Michael Paquier wrote: >> On Mon, Jul 02, 2018 at 02:07:37PM -0400, Robert Haas wrote: >>> I'd rather keep an elog(ERROR) than completely remove the check. >> >> +1. > > Attached Okay, the patch looks logical