From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: David Rowley <david.rowley@2ndquadrant.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Postgres hackers <pgsql-hackers@postgresql.org>
Subject: Re: pgsql: Clarify use of temporary tables within partition trees
Date: Tue, 3 Jul 2018 15:29:36 +0900
Message-ID: <5db5fe6e-4a73-6a24-09e4-060b9f132ea9@lab.ntt.co.jp> (raw)
In-Reply-To: <CAKJS1f8h8283Vb2NcQH+YOMErdDQZWGuqGoe-gX6yT8TKGf0MA@mail.gmail.com>
References: <E1fVSJT-0000Lw-Mu@gemulon.postgresql.org>
<CAKJS1f_HyV1txn_4XSdH5EOhBMYaCwsXyAj6bHXk9gOu4JKsbw@mail.gmail.com>
<CA+TgmoY5EOxJSJCxH09rL1bpFHojpcAKyRym1Y=FiCpOv151mw@mail.gmail.com>
<20180702221650.GA2159@paquier.xyz>
<CAKJS1f9bFnkWX3iDC0DgCdwDSaAMYjWbENmek23FGQx9FkLREw@mail.gmail.com>
<20180703045502.GA26236@paquier.xyz>
<CAKJS1f8f8+3FOBhSoopo15uzHsY76+L8cMKhMwBi+x+bvBU7tg@mail.gmail.com>
<20180703061119.GA11732@paquier.xyz>
<CAKJS1f8h8283Vb2NcQH+YOMErdDQZWGuqGoe-gX6yT8TKGf0MA@mail.gmail.com>
On 2018/07/03 15:16, David Rowley wrote:
> On 3 July 2018 at 18:11, Michael Paquier <michael@paquier.xyz> 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.
>>
>> expand_partitioned_rtentry is new as of v11. Or you mean to tweak
>> expand_inherited_rtentry() perhaps? I am not sure that it is worth it
>> as the code has already diverged between 10 and 11.
>
> Oh right. I'd forgotten that changed in v11. I think the v10 code is
> fine as is then.
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()?
Also, ISTM, this code would be unreachable because
expand_inherited_rtentry would not call here if the above if statement is
true, no?
I see the following two blocks in expand_inherited_rtentry before one gets
to the call to expand_partitioned_rtentry:
if (!has_subclass(parentOID))
{
/* Clear flag before returning */
rte->inh = false;
return;
}
and
if (list_length(inhOIDs) < 2)
{
/* Clear flag before returning */
rte->inh = false;
return;
}
Thanks,
Amit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: Langote_Amit_f8@lab.ntt.co.jp, david.rowley@2ndquadrant.com, michael@paquier.xyz, robertmhaas@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: pgsql: Clarify use of temporary tables within partition trees
In-Reply-To: <5db5fe6e-4a73-6a24-09e4-060b9f132ea9@lab.ntt.co.jp>
References: <E1fVSJT-0000Lw-Mu@gemulon.postgresql.org> <CAKJS1f_HyV1txn_4XSdH5EOhBMYaCwsXyAj6bHXk9gOu4JKsbw@mail.gmail.com> <CA+TgmoY5EOxJSJCxH09rL1bpFHojpcAKyRym1Y=FiCpOv151mw@mail.gmail.com> <20180702221650.GA2159@paquier.xyz> <CAKJS1f9bFnkWX3iDC0DgCdwDSaAMYjWbENmek23FGQx9FkLREw@mail.gmail.com> <20180703045502.GA26236@paquier.xyz> <CAKJS1f8f8+3FOBhSoopo15uzHsY76+L8cMKhMwBi+x+bvBU7tg@mail.gmail.com> <20180703061119.GA11732@paquier.xyz> <CAKJS1f8h8283Vb2NcQH+YOMErdDQZWGuqGoe-gX6yT8TKGf0MA@mail.gmail.com> <5db5fe6e-4a73-6a24-09e4-060b9f132ea9@lab.ntt.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox