Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hJsMU-00009d-RB for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Apr 2019 04:21:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hJsMS-0004uP-GW for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Apr 2019 04:21:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hJsMS-0004sO-2h; Fri, 26 Apr 2019 04:21:20 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hJsMK-0000Wu-5n; Fri, 26 Apr 2019 04:21:18 +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 x3Q4KhkC029151; Fri, 26 Apr 2019 13:20:43 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 8E37E638A74; Fri, 26 Apr 2019 13:20:43 +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 823E1638A49; Fri, 26 Apr 2019 13:20:43 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 7A8194001F0; Fri, 26 Apr 2019 13:20:43 +0900 (JST) Subject: Re: pgsql: Allow insert and update tuple routing and COPY for foreign table References: <5CBDB770.2060602@lab.ntt.co.jp> <5CC04E72.90405@lab.ntt.co.jp> <5CC1B358.5090205@lab.ntt.co.jp> From: Amit Langote Message-ID: <1cc7b8be-d201-8bad-5d98-350faccf095c@lab.ntt.co.jp> Date: Fri, 26 Apr 2019 13:20:31 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <5CC1B358.5090205@lab.ntt.co.jp> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CC-Mail-RelayStamp: 1 To: Etsuro Fujita , Laurenz Albe Cc: Robert Haas , pgsql-committers@lists.postgresql.org, pgsql-hackers@lists.postgresql.org X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Fujita-san, On 2019/04/25 22:17, Etsuro Fujita wrote: > (2019/04/24 22:04), Laurenz Albe wrote: >>    Before PostgreSQL v11, a foreign data wrapper could be certain that >>    BeginForeignModify is always called before ExecForeignInsert. >>    This is no longer true. > > OK, how about something like the attached?  I reworded this a bit, though. Thanks for the patch. + Note that this function is also called when inserting routed tuples into + a foreign-table partition or executing COPY FROM on + a foreign table, in which case it is called in a different way than it + is in the INSERT case. Maybe minor, but should the last part of this sentence read as: ...in which case it is called in a different way than it is in the case INSERT is operating directly on the foreign table. ? Thanks, Amit