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 1rBUtL-00B6pY-Pd for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Dec 2023 07:03:20 +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 1rBUtK-005Bjq-ES for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Dec 2023 07:03:18 +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 1rBUtI-005Bjg-Oy for pgsql-hackers@lists.postgresql.org; Fri, 08 Dec 2023 07:03:18 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rBUtE-00AggL-VX for pgsql-hackers@postgresql.org; Fri, 08 Dec 2023 07:03:15 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 481155C00DA; Fri, 8 Dec 2023 02:03:11 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 08 Dec 2023 02:03:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1702018991; x=1702105391; bh=2C RET8xAH3x+O9k3R8zpwFkckmzlcULdjy6OD/0qd/U=; b=UUztxSbuTT7FnrNzkh zngL/H5SbHSwLy4T8WqnBQZfyJl4Z5AVoTAn04Qv65dWQI1cbZjgAOPVhoGjcJq2 2nJqo4pWhpX2fDQN+DUL+SMBZxi0/AlUvJ3Xke/GD1o1BvqP18B6B1tUckc9TbLc N0WZjm2D+fgwqpXiLGxxMT+x2DK0MCGpSqAnm57d5PqAuad2esbfRQVWzQOrPxCu SFAJisBnwmRUWwa1LInAmOta96Psc3vs1N9Pom4btnOy4uBRgbb/W4Jlc3rBtfMt sGiwCcB5Y5S7D4hIaK5w0Gs/PkGiOGptSjxnN9Spq30ibKviTDr9jsQ/qLDInX80 apGw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1702018991; x=1702105391; bh=2CRET8xAH3x+O 9k3R8zpwFkckmzlcULdjy6OD/0qd/U=; b=v71bbmCrtMKjqpuWOElRCin16+C+s iiSdUvc54zFFzzYuZGVSIsPBP0iOOrCo05nJRfju+vUVDBgOnBO/fG7cqThsGWQi 2rEXOR4n6Tu+encsaTe3H0Fql9IG704CWETvIR4dtWQ48KgQhMtN+R8+JE8UAVuB 0Hi3442+Q8ZegocyTq1NgXGBt/+yZ29Ujm12uUx9lOYuydz/DehDmoQYBPWQcWQ/ ykAr91GUAr+b60rC3Cb3hfABqdjrCEOWFdLwSkyrf/z5YZYnx/2PYAHTqbUdv2yo VaDs5GkI9qfVTf5oHBme7o8ov6mP/x4KLv0ADW1dHo6T/ZdlpL+rUtFyA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudekhedggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 8 Dec 2023 02:03:08 -0500 (EST) Date: Fri, 8 Dec 2023 16:02:55 +0900 From: Michael Paquier To: Masahiko Sawada Cc: Junwang Zhao , Andrew Dunstan , Sutou Kouhei , nathandbossart@gmail.com, pgsql-hackers@postgresql.org Subject: Re: Make COPY format extendable: Extract COPY TO format implementations Message-ID: References: <20231206.162834.1390394858102165899.kou@clear-code.com> <80949637-4e74-6c84-dc4d-908563dade29@dunslane.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fcw5BxdR1X3tCWF7" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --fcw5BxdR1X3tCWF7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Dec 08, 2023 at 03:42:06PM +0900, Masahiko Sawada wrote: > So a custom COPY extension would not be able to define SQL functions > just like arrow(internal) for example. We might need to define a rule > like the function returning copy_in/out_handler must be defined as > _to(internal) and _from(internal). Yeah, I was wondering if there was a trick to avoid the input internal argument conflict, but cannot recall something elegant on the top of my mind. Anyway, I'd be OK with any approach as long as it plays nicely with the query integration, and that's FORMAT's DefElem with its string value to do the function lookups. -- Michael --fcw5BxdR1X3tCWF7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmVyv58ACgkQnvQgOdby QH2/pg//Zm5S7BPQfgmYdcwbb/sY0JZTIkT5rUkHFnyiCqiK7aO3FQXiVo7J/Sab bXx3N6RfDr4WJSrdMmw6syGvpsiCraX9exCfzWUIQ02rN9KMhst5d5dMCAf5qEAO dnr2gDoxLxmNfsOf3och/kf0sXNbYDi1o7lDQJsQeFiK1CH+gHD5ogAEzr2vU5f+ qzoPMwdOiWoctjuUwoz5MsA/vYgZ8d6GfSvpPwvAcqU+VwV+iGJx4gE0AeYSM+Tf jLBB+22zV2teGH4mTCd7/mwezvXDao3Km2RJelYOf/PweNKOq/lw35W6NnFehP+K SGq45XDIGrSvj4Mt3y1odXbpMth3LaagcDn4fOL3IrV4AuQ2xy691D+W650USnDf qDuw6HpMf6WdVh1xT2ExlSUwmL/+E2mboafucR4m5m+Ax9TqhvonHH8eDT/PrADg /gFv71I1GH5xSyuFMHSvZgWRBnf/y4Ejo7NymJeT+D25ahxIsHQ7gn64CGYszzxL S3uTNS+jXWKTEqs6AIept6k+9Mx14Ymu9G0zHkU75EGkluY3iFUGD04VdeB+x5FN mmcEk/TG64bbbsy45ZpAKzD7BTJGjPVLp9upjAhI9JZk1p+EKWQvFWKQZDsolcxj 4O7eOcY79XELnQfyW8IYLOfn8LOBjnn6G3i9/IXbh3LJd7vZ+fo= =hvx3 -----END PGP SIGNATURE----- --fcw5BxdR1X3tCWF7--