Re: pgsql: Clarify use of temporary tables within partition trees
Amit Langote <langote_amit_f8@lab.ntt.co.jp>
From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: David Rowley <david.rowley@2ndquadrant.com>,
Michael Paquier <michael@paquier.xyz>
Cc: Robert Haas <robertmhaas@gmail.com>,
Postgres hackers <pgsql-hackers@postgresql.org>
Date: 2018-07-03T06:49:44Z
Lists: pgsql-hackers
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 = false;
> + return;
> + }
> +
>
> Why is this not near the beginning of expand_partitioned_rtentry()?
This one still stands I think.
> Also, ISTM, this code would be unreachable because
> expand_inherited_rtentry would not call here if the above if statement is
> true, no?
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.
Thanks,
Amit
Commits
-
Remove dead code for temporary relations in partition planning
- 5fca035903a2 11.0 landed
- fc057b2b8fc3 12.0 landed
-
Clarify use of temporary tables within partition trees
- 5862174ec78a 10.5 cited
-
Expand partitioned table RTEs level by level, without flattening.
- 0a480502b092 11.0 cited