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 1hJfNZ-0005SE-Qx for pgsql-committers@arkaria.postgresql.org; Thu, 25 Apr 2019 14:29:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hJfNY-0007PB-A9 for pgsql-committers@arkaria.postgresql.org; Thu, 25 Apr 2019 14:29:36 +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 1hJfNX-0007P1-Vc; Thu, 25 Apr 2019 14:29:36 +0000 Received: from mx2a.mailbox.org ([2001:67c:2050:104:0:2:25:2] helo=mx2.mailbox.org) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hJfNU-0004WS-VH; Thu, 25 Apr 2019 14:29:34 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 2D6DCA0D20; Thu, 25 Apr 2019 16:29:28 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id AEznK-YUQk8n; Thu, 25 Apr 2019 16:29:11 +0200 (CEST) Message-ID: Subject: Re: pgsql: Allow insert and update tuple routing and COPY for foreign table From: Laurenz Albe To: Etsuro Fujita Cc: Robert Haas , pgsql-committers@lists.postgresql.org, pgsql-hackers@lists.postgresql.org Date: Thu, 25 Apr 2019 16:29:08 +0200 In-Reply-To: <5CC1B358.5090205@lab.ntt.co.jp> References: <5CBDB770.2060602@lab.ntt.co.jp> <5CC04E72.90405@lab.ntt.co.jp> <5CC1B358.5090205@lab.ntt.co.jp> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 2019-04-25 at 22:17 +0900, Etsuro Fujita wrote: > > The documentation of ExecForeignInsert should mention something like: > > > > ExecForeignInsert is called for INSERT statements as well > > as for COPY FROM and tuples that are inserted into a foreign table > > because it is a partition of a partitioned table. > > > > In the case of a normal INSERT, BeginForeignModify will be called > > before ExecForeignInsert to perform any necessary setup. > > In the other cases, this setup has to happen in BeginForeignInsert. > > These seem a bit redundant to me [...] > > OK, how about something like the attached? I reworded this a bit, though. I like your patch better than my wording. Thanks for the effort! Yours, Laurenz Albe