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 1r7e5t-0067vk-FU for pgsql-general@arkaria.postgresql.org; Mon, 27 Nov 2023 16:04:22 +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 1r7e5r-00EqUv-Ui for pgsql-general@arkaria.postgresql.org; Mon, 27 Nov 2023 16:04:19 +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 1r7e5q-00EqUg-51 for pgsql-general@lists.postgresql.org; Mon, 27 Nov 2023 16:04:19 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7e5h-008oo5-Up for pgsql-general@lists.postgresql.org; Mon, 27 Nov 2023 16:04:17 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id EB3C55C0287; Mon, 27 Nov 2023 11:04:06 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 27 Nov 2023 11:04:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding: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=fm3; t= 1701101046; x=1701187446; bh=3v26FOtlMtzu++fzhBEwCVEQc50mpWHyJHb 0dSoS17A=; b=l7MmszwYvH4imilbMwdgFr5jpgZCQ8J2JbAF3807uCA/swRd1jJ FVQ4bOT1Y/g6kTiPZ/FkLdSg+8VzVHGzv5BtyFVnykxctLMtroA5AlI3/CypuJXA zLfaDHqzuOnRUIcTWLbJe5XUJNJco/diU2n5i+lbKYl6sdjmd9HhM5tcDJPdgHha v5yC66PSEP0DwZuk0Egaxo52pdw6oqbP+N3FGKB5tvEI3PdU1GZtDBpTtLraAQxz u/o0fTfCePqI9i23AMK8pcIiQl5FmyupP4W2VLCC5Vwzb6V4Gd+ulfv2VnIJqyhv C+x1WEEYmvba1zl2yBALVlZxCXvVdGnDfgA== 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 :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= 1701101046; x=1701187446; bh=3v26FOtlMtzu++fzhBEwCVEQc50mpWHyJHb 0dSoS17A=; b=WX+r4XO2x4gia4Tcl5vrHVZLvTETmR7XU9rF7LbD6LDa/v3x5Z+ gEt78UpladKk1v3fIj+JZD/KGUGTFXNX3rZZSbsZ33GYeQcUC+Cu4J8jYeFMLl/l ITxRYwPudpD2mcNVePyBuPrb9J4pND0NCfKMqLTbvqEEq+sjaE2cIQ1QFfCXfOIH b9FwpTuX3y9bH30LYdu+K2wfMUolC+Ir/C0t6eVYEovj7h+4XmBM1AWB5vKcD+ru Z+bkZvsJ5rn9G3wn1hPY0t1jk8cM7SVBATEEmM+EhnhG98Ncil4tsCxT9SR8xAsC elqjT0E9QnxtUqL40fVOXlZClP0dcIs+39A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeiuddgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepfeegfeeiuedtgffgteeggfehkeejheetieeliefg teeikeejvdeiveeigfehvedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Nov 2023 11:04:06 -0500 (EST) Message-ID: Date: Mon, 27 Nov 2023 08:04:05 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Emitting JSON to file using COPY TO To: Dominique Devienne Cc: Davin Shearer , pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/27/23 01:44, Dominique Devienne wrote: > On Mon, Nov 27, 2023 at 10:33 AM Dominique Devienne > wrote: > > On second thought, I guess that's COPY in its text modes doing the escaping? > Interesting. The text-based modes of COPY are configurable. There's even > a JSON mode. Where are you seeing the JSON mode for COPY? AFAIK there is only text and CSV formats. > By miracle, would the JSON output mode recognize JSON[B] values, and > avoid the escaping? > > -- Adrian Klaver adrian.klaver@aklaver.com