Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faF8a-00087C-WD for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Jul 2018 06:50:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1faF8Z-0004Xc-AM for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Jul 2018 06:50:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faF8Z-0004XV-3i for pgsql-hackers@lists.postgresql.org; Tue, 03 Jul 2018 06:50:07 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1faF8U-000329-40 for pgsql-hackers@postgresql.org; Tue, 03 Jul 2018 06:50:06 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id w636nsdw020926; Tue, 3 Jul 2018 15:49:54 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 73B2D638D3E; Tue, 3 Jul 2018 15:49:54 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 680B9638C87; Tue, 3 Jul 2018 15:49:54 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 5F5174001D2; Tue, 3 Jul 2018 15:49:54 +0900 (JST) Subject: Re: pgsql: Clarify use of temporary tables within partition trees From: Amit Langote References: <20180702221650.GA2159@paquier.xyz> <20180703045502.GA26236@paquier.xyz> <20180703061119.GA11732@paquier.xyz> <5db5fe6e-4a73-6a24-09e4-060b9f132ea9@lab.ntt.co.jp> Message-ID: Date: Tue, 3 Jul 2018 15:49:44 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <5db5fe6e-4a73-6a24-09e4-060b9f132ea9@lab.ntt.co.jp> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: David Rowley , Michael Paquier Cc: Robert Haas , Postgres hackers X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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