Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJLfG-0006Ij-Af for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Nov 2017 15:49:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJLfF-0007Id-St for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Nov 2017 15:49:45 +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 1eJLfF-0007IS-M9 for pgsql-hackers@lists.postgresql.org; Mon, 27 Nov 2017 15:49:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eJLfC-0006vd-4h for pgsql-hackers@postgresql.org; Mon, 27 Nov 2017 15:49:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id vARFnWtC018637; Mon, 27 Nov 2017 10:49:32 -0500 From: Tom Lane To: Dean Rasheed cc: Etsuro Fujita , Ashutosh Bapat , Ildus Kurbangaliev , Dilip Kumar , PostgreSQL Hackers , Robert Haas Subject: Re: [HACKERS] Bug in ExecModifyTable function and trigger issues for foreign tables In-reply-to: References: <20170514150525.0346ba72@postgrespro.ru> <20170515165455.545dd3d6@wp.localdomain> <20170516150516.1b616230@wp.localdomain> <20170615180548.5e142ddc@wp.localdomain> <0bc9c28b-96ca-c875-871e-16af6f53ecd9@lab.ntt.co.jp> <428f1672-df54-de01-91da-b57365193bf4@lab.ntt.co.jp> <6c651916-8fde-f9c9-b199-080df1bf2867@lab.ntt.co.jp> <280720c5-7aad-1136-6be3-654208c8f714@lab.ntt.co.jp> <8065.1500475011@sss.pgh.pa.us> <9cd25d80-08fc-568c-3181-dbe98723d0db@lab.ntt.co.jp> <3e9ff40d-d00f-3363-dcee-97ce023c7884@lab.ntt.co.jp> <14028.1511736992@sss.pgh.pa.us> Comments: In-reply-to Dean Rasheed message dated "Mon, 27 Nov 2017 11:19:31 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18635.1511797772.1@sss.pgh.pa.us> Date: Mon, 27 Nov 2017 10:49:32 -0500 Message-ID: <18636.1511797772@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Dean Rasheed writes: > I wonder if, years from now, it might look a bit odd that > rewriteTargetListUD() is doing part of work of preptlist.c, is only > called from there, and yet is located in the rewriter. Yeah, I probably wouldn't have done it like this in a green field, but maintaining traceability to the existing code is valuable IMO. > A separate point -- it might be marginally more efficient to have the > work of rewriteTargetListUD() done after expand_targetlist() to avoid > the possible renumbering of the resjunk entries. Hm. It wouldn't save a lot, but yeah, doing it in this order seems a bit silly when you put it like that. regards, tom lane