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 1rXEgD-009SiU-Vm for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Feb 2024 06:11:38 +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 1rXEgC-000yNY-Ms for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Feb 2024 06:11:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rXEgC-000yNP-Bd for pgsql-hackers@lists.postgresql.org; Tue, 06 Feb 2024 06:11:36 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rXEg7-005JLq-5g for pgsql-hackers@postgresql.org; Tue, 06 Feb 2024 06:11:35 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 7FFDD3200A6D; Tue, 6 Feb 2024 01:11:28 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 06 Feb 2024 01:11:29 -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:subject :subject:to:to; s=fm3; t=1707199888; x=1707286288; bh=eJdJT+U41P oVdgJUcaW2/NLB/fjeFh0/Hku6+/nZdqE=; b=DEcfHQXLJFnQSoWy/mJfH7Mi5I nGtZZnXyJFTCpT6BdLMtbjpSEPyq8R3Awhwj9Gb79hhBwI3R1IcbQriFlLEbJaoy QjSzUDt0+TZwiV0Lr0WMbKpGlMcE1bJAHC869eQxbjNN9QjcjMOelNZA2iyqNl/6 m/jzTWmghf0vAYrLu9Y7J2pzvbNgLt5BHsNebdZ3oaSxLUA5rRMVxRqtL2NeRvvV M9aKLZPfwf0nf3BS5OlEeMU3Tr7jX4u1/hD6rLm+T+9IVsw+RsrHu0/Ne9nj+ThG 8GFrnamIdYj4tsSkt5mIobPDUJLKxe7RmHDDyMPY2wnuLyfae+5NMj0puthQ== 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:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1707199888; x=1707286288; bh=eJdJT+U41PoVdgJUcaW2/NLB/fje Fh0/Hku6+/nZdqE=; b=yJoj7I9kTHR7L84Y12UnBU/LDhF8vHpJ/ji/lcJu35V5 wLRftsuFcb8QGSFroQVCgDC68vplIVPW2i1GAkR/3zyPQUHvkZXoV9MU3k9Bq4XG JfWj3kNcDB0EOjEa4WSnN7ox9fTLOC4E8A5au5Rt25mFE8cfz/vDrs1ih11jt2mm VXhFnmUgnoV1yhrjn1bOYVpsVH5dTaShQKraG+XQIeQoK4fuFho6QwKN+9Nzsvts m7oyObFs31LsGQUqYfFGMKohT4bM8H/ah/OhrI0uQmvUDFML9aPWfyUAh/Sc8KLE RarjbEnjQT8B8UoJ/XLRiNen3YyXrAi6QuHcyvSLMQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedvvddgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 6 Feb 2024 01:11:25 -0500 (EST) Date: Tue, 6 Feb 2024 15:11:05 +0900 From: Michael Paquier To: Andres Freund Cc: Sutou Kouhei , sawada.mshk@gmail.com, zhjwpku@gmail.com, andrew@dunslane.net, nathandbossart@gmail.com, pgsql-hackers@postgresql.org Subject: Re: Make COPY format extendable: Extract COPY TO format implementations Message-ID: References: <20240202.163319.975394400703526633.kou@clear-code.com> <20240202.174618.349091157390883477.kou@clear-code.com> <20240205182118.h5rkbnjgujwzuxip@awork3.anarazel.de> <20240206014125.qofww7ew3dx3v3uk@awork3.anarazel.de> <20240206054642.qikm7s7jzy4bmdzn@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ZboHWEV4jPMDjkgG" Content-Disposition: inline In-Reply-To: <20240206054642.qikm7s7jzy4bmdzn@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ZboHWEV4jPMDjkgG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Feb 05, 2024 at 09:46:42PM -0800, Andres Freund wrote: > No - what I mean is that it doesn't make sense to have copy_attribute_out(), > as e.g. CopyToTextOneRow() already knows that it's dealing with text, so it > can directly call the right function. That does require splitting a bit more > between csv and text output, but I think that can be done without much > duplication. I am not sure to understand here. In what is that different from reverting 2889fd23be56 then mark CopyAttributeOutCSV and CopyAttributeOutText as static inline? Or you mean to merge CopyAttributeOutText and CopyAttributeOutCSV together into a single inlined function, reducing a bit code readability? Both routines have their own roadmap for encoding_embeds_ascii with quoting and escaping, so keeping them separated looks kinda cleaner here. -- Michael --ZboHWEV4jPMDjkgG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmXBzXkACgkQnvQgOdby QH3dMw/8DO6MaiG5xl9nQydlUqX6ZCqEMeafhS8Vh7nHwDkzl1zyXJp7z3wmRP5t 43c57VrPCFdFlzl5iB4AnTl1s2M79dM60huT1f5NoCIYSc395VqNBCUOVtJmMqax 5ez7E5qbJYQhQxxsoZr0K4uLikD3RmDBJu58LhD1jVbgh39RmeWQaIjJ4LCUE/f/ dvVXMCXF9jsnIGh+VaqGoNrmb76IlF/d0tGMXfS1pMbuKqeMHCl7DTVHY/Qd+fxI 4N+1OwSuEzNNNpiMRn2TJJTr5tNDH2r533sY+/QqfCZytnwRmRbOAi4DfRuK2rh9 9gQvfeGvv8FwEMm5MNW2WYPcKJtGrseQ3ViAKdTNGbtfn9eO1BJjtP9HdVZce3IB iYf0PI7kfDEYFUXQ8Nh2COi1NXPep8ruWvCqZenCCJS4k/fuuhcPQPaMMpnVFXd5 scTCy+UVXRSoD0cPYeawyprcGUNxhD4SXn2YlQuke3z2VmqRGm71nlIIlW8dLLZT c/yYkmHZqLfgrpjzrEdqFmSsuoRbfCWBa+3lQoj5BFs4pbNdLTFyW+ac4qdiBDhG EmgIHPK+TStUGGK5MmUNdGEyBYe5qXch7sXJUvlc6iekm/jqXO12JpEoRfAHXV0D PmVvtissbnuGkDHK3uNQAtNYJ6rKoenRHH28fuz1cfdXOaV0GnM= =S2MW -----END PGP SIGNATURE----- --ZboHWEV4jPMDjkgG--