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 1r9xl3-003gxF-UY for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Dec 2023 01:28:25 +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 1r9xky-00DvXs-Qp for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Dec 2023 01:28:20 +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 1r9xky-00DvXb-HA for pgsql-hackers@lists.postgresql.org; Mon, 04 Dec 2023 01:28:20 +0000 Received: from mxout1-ec2-va.apache.org ([3.227.148.255]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r9xkw-009y7x-4o for pgsql-hackers@postgresql.org; Mon, 04 Dec 2023 01:28:19 +0000 Received: from mail.apache.org (mailgw-he-de.apache.org [116.203.246.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with ESMTPS id 46AED44090 for ; Mon, 4 Dec 2023 01:28:03 +0000 (UTC) Received: (qmail 1080582 invoked by uid 116); 4 Dec 2023 01:28:02 -0000 Received: from mailrelay1-he-de.apache.org (HELO mailrelay1-he-de.apache.org) (116.203.21.61) by apache.org (qpsmtpd/0.94) with ESMTP; Mon, 04 Dec 2023 01:28:02 +0000 Authentication-Results: apache.org; auth=none Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mailrelay1-he-de.apache.org (ASF Mail Server at mailrelay1-he-de.apache.org) with ESMTPSA id E3CC040C5E for ; Mon, 4 Dec 2023 01:28:01 +0000 (UTC) Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-286ad92aca6so418835a91.3 for ; Sun, 03 Dec 2023 17:28:01 -0800 (PST) X-Gm-Message-State: AOJu0YzXWUHtz5Gd+a6vXcEiJENXsGD13xUGnFEZJQNqaN7QhbFvG97A MQH5tXHzFL/ml/LnZo/xfUxQh9eASlNZ1ah9LPg= X-Google-Smtp-Source: AGHT+IHNAMq1IYR/GHkwwEZSnUALwyttRikyHPlvVkFpJXdB6AtQLtxBPLNl6QaJCTVI7HPRYS7QR2iNykmCGMRjd5w= X-Received: by 2002:a17:90b:390b:b0:280:c98f:2090 with SMTP id ob11-20020a17090b390b00b00280c98f2090mr2465120pjb.32.1701653280333; Sun, 03 Dec 2023 17:28:00 -0800 (PST) MIME-Version: 1.0 References: <3853387.1701096982@sss.pgh.pa.us> <3a98decf-3fe3-4b49-9b68-fda01338872c@sedlakovi.org> <24e3ee88-ec1e-421b-89ae-8a47ee0d2df1@joeconway.com> <7117a356-916c-4cf3-bad8-861490e65dcf@joeconway.com> In-Reply-To: From: Davin Shearer Date: Sun, 3 Dec 2023 20:27:49 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Emitting JSON to file using COPY TO To: PostgreSQL-development Cc: Joe Conway Content-Type: multipart/alternative; boundary="0000000000004e2876060ba50708" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004e2876060ba50708 Content-Type: text/plain; charset="UTF-8" I worked around it by using select json_agg(t)... and redirecting it to file via psql on the command line. COPY TO was working until we ran into broken JSON and discovered the double quoting issue due to some values containing " in them. --0000000000004e2876060ba50708 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I worked around it by using select json_agg(t)... and red= irecting it to file via psql on the command line. COPY TO was working until= we ran into broken JSON and discovered the double quoting issue due to som= e values containing " in them.=C2=A0
--0000000000004e2876060ba50708--