Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXq7e-00027s-W1 for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jul 2017 14:38:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dXq7e-0001o4-IY for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jul 2017 14:38:42 +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 1dXq66-0006xt-30 for pgsql-hackers@postgresql.org; Wed, 19 Jul 2017 14:37:06 +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.84_2) (envelope-from ) id 1dXq62-0004SH-If for pgsql-hackers@postgresql.org; Wed, 19 Jul 2017 14:37:05 +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 v6JEaqeL008066; Wed, 19 Jul 2017 10:36:52 -0400 From: Tom Lane To: Etsuro Fujita cc: Ashutosh Bapat , Ildus Kurbangaliev , Dilip Kumar , PostgreSQL Hackers , Robert Haas Subject: Re: Bug in ExecModifyTable function and trigger issues for foreign tables In-reply-to: <280720c5-7aad-1136-6be3-654208c8f714@lab.ntt.co.jp> References: <20170514150525.0346ba72@postgrespro.ru> <20170515121638.0c076bcc@wp.localdomain> <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> Comments: In-reply-to Etsuro Fujita message dated "Wed, 19 Jul 2017 19:21:04 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8064.1500475011.1@sss.pgh.pa.us> Date: Wed, 19 Jul 2017 10:36:51 -0400 Message-ID: <8065.1500475011@sss.pgh.pa.us> 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 Etsuro Fujita writes: > * Modified rewrite_targetlist(), which is a new function added to > preptlist.c, so that we do const-simplification to junk TLEs that > AddForeignUpdateTargets() added, as that API allows the FDW to add junk > TLEs containing non-Var expressions to the query's targetlist. This does not seem like a good idea to me. eval_const_expressions is not a cheap thing, and for most use-cases those cycles will be wasted, and it has never been the responsibility of preprocess_targetlist to do this sort of thing. Please put the responsibility of doing const-expression simplification in these cases somewhere closer to where the problem is being created. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers