Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cT0Pj-00081x-7s for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Jan 2017 06:05:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cT0Pi-0002EG-Hb for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Jan 2017 06:05:06 +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.84_2) (envelope-from ) id 1cT0Pg-0002Cc-J3 for pgsql-hackers@postgresql.org; Mon, 16 Jan 2017 06:05:04 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cT0Pb-0005fr-9D for pgsql-hackers@postgresql.org; Mon, 16 Jan 2017 06:05:04 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id v0G64piA032496; Mon, 16 Jan 2017 15:04:51 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 378C75F592; Mon, 16 Jan 2017 15:04:51 +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 21E905F680; Mon, 16 Jan 2017 15:04:51 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTP id 0F3DF400B95; Mon, 16 Jan 2017 15:04:51 +0900 (JST) Subject: Re: [COMMITTERS] pgsql: Fix a bug in how we generate partition constraints. References: <20170113200957.7rdnmtiuatxd3ix6@alvherre.pgsql> From: Amit Langote Message-ID: <9ce97382-54c8-deb3-9ee9-a2ec271d866b@lab.ntt.co.jp> Date: Mon, 16 Jan 2017 15:04:38 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------80C8914A5808EEA525B2849D" To: Amit Langote , Robert Haas Cc: Alvaro Herrera , "pgsql-hackers@postgresql.org" X-TM-AS-MML: disable X-Pg-Spam-Score: -5.8 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org This is a multi-part message in MIME format. --------------80C8914A5808EEA525B2849D Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 2017/01/14 13:36, Amit Langote wrote: > On Sat, Jan 14, 2017 at 6:10 AM, Robert Haas wrote: >> On Fri, Jan 13, 2017 at 3:09 PM, Alvaro Herrera wrote: >>> >>> I'm just saying that the problem at hand is already solved for a related >>> feature, so ISTM this new code should use the recently added routine >>> rather than doing the same thing in a different way. >> >> Oh, I see. Amit, thoughts? > > Hm, perhaps. The code in map_partition_varattnos() that creates the > map could be replaced by a call to the new > convert_tuples_by_name_map(). In fact, it could even have used the > old version of it (convert_tuples_by_name()). I guess I just aped > what other callers of map_variable_attnos() were doing, which is to > generate the map themselves (not that they ought to be changed to use > convert_tuples_by_name_map). > > I will send a patch at my earliest convenience. Thanks to Alvaro for > pointing that out. And here is the patch. Thanks, Amit --------------80C8914A5808EEA525B2849D Content-Type: text/x-diff; name="0001-Avoid-code-duplication-in-map_partition_varattnos.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename*0="0001-Avoid-code-duplication-in-map_partition_varattnos.patch"