Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tM3TN-001LH9-Fo for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Dec 2024 11:04:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tM3TK-005KiN-VU for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Dec 2024 11:04:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tM3TK-005Kel-JN for pgsql-hackers@lists.postgresql.org; Fri, 13 Dec 2024 11:04:39 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tM3TH-002d1U-Vi for pgsql-hackers@postgresql.org; Fri, 13 Dec 2024 11:04:38 +0000 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.stl.internal (Postfix) with ESMTP id 2FC6D1140134; Fri, 13 Dec 2024 06:04:35 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Fri, 13 Dec 2024 06:04:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1734087875; x=1734174275; bh=r LAmtvFuaXw4ry3CvdBhiVhIYUWk94id0Rn8//zhSno=; b=AzbqF5b7WhtkMIoqR 4ar2UAXYEx1jgfS0cRPAxfKcFO+YUoxNiioRRUNBqyPoLGLVWrKSVE30btLnrIX4 TE3Tu4AkKDQtvvXABuPHOeK1XARtak2ulq1i/zm58QTHcIV/7gA8LQYnrTD/SAd3 sXMp2GL/ZLqI1TiGNR0o/86kiWxDSq8scbNQliqQXOl27c0ejEgZ+6Dx6WrdXtLr G0xq/0S9jWDFexN5QDv3kOV1ikJ86CAl4jBpOlh1sS6trTQ7zSWLPeLJgWBNJRRn +fvFDGYSd5VKZyryb96S5ByK0K+49leRP+omM3TerBXp4mFEB+ggAA3nVetf0sv2 4IBCw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkeejgddvfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecu hfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrd hnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfej jefhgfeiueeukeejkeffgfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprh hishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspghrtg hpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepmhgrthhhvghushhs shhilhhvleejsehgmhgrihhlrdgtohhmpdhrtghpthhtohepohhnuggvrhhkrghlrggtih esghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhs thhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 13 Dec 2024 06:04:34 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1734087873; bh=z0o5/3KxHJigj1D5gSj2qmwT55IxIBsULwUzEXLfhFY=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=XnXPHE3xw161wg+i4NmfC+4OK+F5sVzsgnkWNIzYA1qHy8jjnDAzGTvgqkpFYfhXG IF+iABlyH7ltb8BWYc06vruQ88Bh7B6/oLuxV5KMVxLcrCSt0yQDfmRaGKZMoKDOVt 8x4bF/oWS10UK/jlLClAm1pqmTFpazTS8d0U06gAFso1X4723B4oCXb3cYb8/J1v/P pvlDjNh4bWnEYVsMm/0RA5oOdCLC7lwUMjnyMRna9ACDsfhTAolJavLAzP5iUEw9vm ZGBzEAT1jINa8EdHViuGb2NZiO4NOR205QwY+DqzswHseUldcKVHZxJ3NrHCmn1lJv 0Gf4cZXQOuYWw== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 6D1829E; Fri, 13 Dec 2024 12:04:33 +0100 (CET) Date: Fri, 13 Dec 2024 12:04:33 +0100 From: Alvaro Herrera To: =?utf-8?B?w5ZuZGVyIEthbGFjxLE=?= Cc: Matheus Alcantara , Pg Hackers Subject: Re: Allow FDW extensions to support MERGE command via CustomScan Message-ID: <202412131104.ch4ogwcbr3ml@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Dec-13, Önder Kalacı wrote: > Matheus Alcantara wrote: > > I didn't understand what is a "custom scan node" on the fdw context at > > first place (I don't know if it is an already know word on this > > context), but from what I've understood so far, to a fdw extension > > support MERGE it should implements on PlanForeignModify right? > > In the long term, I think that's a good plan. First, the core code in > ExecMerge() should be aware of foreign tables, then each foreign table > should handle Merge command planning on its own PlanForeignModify. > That'd be great, because the execution of Merge command is pretty > complex, and in essence Postgres would be providing the solid > infrastructure for all foreign tables. > > However, I expect that to be a non-trivial patch. Instead, the goal of > this patch is to at least let extensions to completely override the > planning & execution via CustomScan, not confined to Postgres' foreign > table planning & execution. IMO this is a bad plan. It'll become _the_ way to run MERGE on foreign tables, which will become a selling point for proprietary FDWs, and nobody will be motivated to write the code to implement the long-term plan you were describing. In short, -1 from me. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/