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 1hIgAW-0004UC-TS for pgsql-committers@arkaria.postgresql.org; Mon, 22 Apr 2019 21:08:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hIgAV-0006zb-Jf for pgsql-committers@arkaria.postgresql.org; Mon, 22 Apr 2019 21:08:03 +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 1hIgAV-0006yZ-8j; Mon, 22 Apr 2019 21:08:03 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIgAO-00017z-6v; Mon, 22 Apr 2019 21:08:02 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id DFEB621FB6; Mon, 22 Apr 2019 17:07:54 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 22 Apr 2019 17:07:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=qOc5jRBdxPUXWDOQbxwGcwpj1k6 qzch+3ozxo25JWks=; b=Bylmg3i6ocgnqtH+JRfpT0QGapBjurn0Rs+RNaG+9KW 3KVbXWzH7tLoq/hA0ViAncLaMZAIu5AHx3dvfuSIwaQ2PeI4lV/AyiNhC0kmJOdo 7bTptBKd2aDT+Znrl42dHwaD+J++dTnp9NoepSN4ZlVs8H9PdJtj/d6Mr7iF2Csw BTqVZiw97OnnxxpR9mpmFg6Y78QNeImWDeRCHH6tHdLUa114j+t9DI7zdrHu3+Zj daJX5yVq6ic0pUg2ZWmrqQNaHt/gFUcwzbK29HkDjq9mCw8+nnjzNbd7RtgJ4BHQ 7ulPfyPuBkzlwCZGWqmgHf05K39pt1jiVVG9n3knfIg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=qOc5jR BdxPUXWDOQbxwGcwpj1k6qzch+3ozxo25JWks=; b=ZMt5fHE03y1kQ4M/EexscR p8jrR8pjyXMN6WVIjuzqbBeef0yQxV8lSScqHwyXUUSjswh87ahhYOI4c3SHC+1I kern0t8D6nMzzLMDWCze/auZytyOcaw9eqsSHs1aD/vssIA2x/tz1I5gYNyOvfRx Quv/2nRRqubO0LWZZGn8GRbc0ThlVuIdwsesqQgozPsaXoZX7oQgDBFWADjBt4QV rqymEW2SN8WVRFvzYjMMG0QYemg3qq5EKITOvqQa9/zshj2r/UR/+xXDUia1ViXs VJNBzenMl3dT/DG428AkBdMWh3/No+LU9xenlJkjgGtBDT1AOVM4p8FqEmIV6kxg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrgeeigddugeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucfkpheple ekrddvuddtrddugedtrddujedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgv shesrghnrghrrgiivghlrdguvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 887E3103CA; Mon, 22 Apr 2019 17:07:53 -0400 (EDT) Date: Mon, 22 Apr 2019 14:07:51 -0700 From: Andres Freund To: Laurenz Albe Cc: Etsuro Fujita , Robert Haas , pgsql-committers@lists.postgresql.org, pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Allow insert and update tuple routing and COPY for foreign table Message-ID: <20190422210751.sbgtmweuaodcu2er@alap3.anarazel.de> References: <5CBDB770.2060602@lab.ntt.co.jp> <20190422202703.4mgtqv3mqtamsgel@alap3.anarazel.de> <333528b0ada7111cb6bc51cae6158f92d4e9d0f1.camel@cybertec.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <333528b0ada7111cb6bc51cae6158f92d4e9d0f1.camel@cybertec.at> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019-04-22 22:56:20 +0200, Laurenz Albe wrote: > On Mon, 2019-04-22 at 13:27 -0700, Andres Freund wrote: > > On 2019-04-22 21:37:25 +0200, Laurenz Albe wrote: > > > Commit 3d956d956a introduced support for foreign tables as partitions > > > and COPY FROM on foreign tables. > > > > > > If a foreign data wrapper supports data modifications, but either has > > > not adapted to this change yet or doesn't want to support it > > > for other reasons, it probably got broken by the above commit, > > > because COPY will just call ExecForeignInsert anyway, which might not > > > work because neither PlanForeignModify nor BeginForeignModify have > > > been called. > > > > > > To avoid breaking third-party foreign data wrappers in that way, allow > > > COPY FROM and tuple routing for foreign tables only if the foreign data > > > wrapper implements BeginForeignInsert. > > > > Isn't this worse though? Before this it's an API change between major > > versions. With this it's an API change in a *minor* version. Sure, it's > > one that doesn't crash, but it's still a pretty substantial function > > regression, no? > > Hm, that's a good point. > You could say that this patch is too late, because a FDW might already be > relying on COPY FROM to work without BeginForeignInsert in v11. I think that's the case. > How about just applying the patch from v12 on? > Then it is a behavior change in a major release, which is acceptable. > It requires the imaginary FDW above to add an empty BeginForeignInsert > callback function, but will unbreak FDW that slept through the change > that added COPY support. I fail to see the advantage. It'll still require FDWs to be fixed to work correctly for v11, but additionally adds another set of API differences that needs to be fixed by another set of FDWs. I think this ship simply has sailed. Greetings, Andres Freund