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 1rBgqO-00Bx7Z-4I for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Dec 2023 19:49:04 +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 1rBgqM-00BGqZ-Qd for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Dec 2023 19:49:02 +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 1rBgmz-00BC6G-Ae for pgsql-hackers@lists.postgresql.org; Fri, 08 Dec 2023 19:45:33 +0000 Received: from mail.verite.pro ([185.16.44.216]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rBgmw-009Sat-Je for pgsql-hackers@postgresql.org; Fri, 08 Dec 2023 19:45:32 +0000 Received: by mail.verite.pro (Postfix, from userid 1000) id F37938C078D; Fri, 8 Dec 2023 20:45:27 +0100 (CET) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "Daniel Verite" Subject: Re: Emitting JSON to file using COPY TO To: "Joe Conway" Cc: Andrew Dunstan , Davin Shearer , PostgreSQL-development In-Reply-To: <4162f7f7-6fd6-4720-98e2-89f80e3de2ed@joeconway.com> Date: Fri, 08 Dec 2023 20:45:23 +0100 Message-Id: X-Mailer: Manitou v1.7.3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Joe Conway wrote: > copyto_json.007.diff When the source has json fields with non-significant line feeds, the COPY output has these line feeds too, which makes the output incompatible with rule #2 at https://jsonlines.org ("2. Each Line is a Valid JSON Value"). create table j(f json); insert into j values('{"a":1, "b":2 }'); copy j to stdout (format json); Result: {"f":{"a":1, "b":2 }} Is that expected? copy.sgml in 007 doesn't describe the output in terms of lines so it's hard to tell from the doc. Best regards, --=20 Daniel V=E9rit=E9 https://postgresql.verite.pro/ Twitter: @DanielVerite