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 1rAZTp-007DMY-74 for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Dec 2023 17:45:09 +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 1rAZTn-004zVi-Uu for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Dec 2023 17:45:07 +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 1rAZTn-004zVY-L8 for pgsql-hackers@lists.postgresql.org; Tue, 05 Dec 2023 17:45:07 +0000 Received: from mxout1-he-de.apache.org ([95.216.194.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rAZTj-008x7v-V2 for pgsql-hackers@postgresql.org; Tue, 05 Dec 2023 17:45:06 +0000 Received: from mail.apache.org (mailgw-he-de.apache.org [IPv6:2a01:4f8:c2c:d4aa::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with ESMTPS id D1F3966F99 for ; Tue, 5 Dec 2023 17:43:44 +0000 (UTC) Received: (qmail 2269263 invoked by uid 116); 5 Dec 2023 17:43:44 -0000 Received: from ec2-52-204-25-47.compute-1.amazonaws.com (HELO mailrelay1-ec2-va.apache.org) (52.204.25.47) by apache.org (qpsmtpd/0.94) with ESMTP; Tue, 05 Dec 2023 17:43:44 +0000 Authentication-Results: apache.org; auth=none Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mailrelay1-ec2-va.apache.org (ASF Mail Server at mailrelay1-ec2-va.apache.org) with ESMTPSA id E2AC73FF69 for ; Tue, 5 Dec 2023 17:43:43 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-286b4a84044so1796508a91.1 for ; Tue, 05 Dec 2023 09:43:43 -0800 (PST) X-Gm-Message-State: AOJu0YwbCQki+OXD3EGYcxg/kikSlLFmVzDN8svmEgMdVgFFw6ADWIAY IInNW0mvzTl0kcos/TxedJqO2kLh8qGdBRVbSZY= X-Google-Smtp-Source: AGHT+IHnrt9MkgAw/V4tP9pPSFC6cLSTxmkO+5pHyV8Nxg2wn7XONOEU3cgOcsT+VpL6u72PldlmwzevM6tu3y0Vd8w= X-Received: by 2002:a17:90b:1e43:b0:286:b062:ab7 with SMTP id pi3-20020a17090b1e4300b00286b0620ab7mr1255579pjb.41.1701798222829; Tue, 05 Dec 2023 09:43:42 -0800 (PST) MIME-Version: 1.0 References: <24e3ee88-ec1e-421b-89ae-8a47ee0d2df1@joeconway.com> <7117a356-916c-4cf3-bad8-861490e65dcf@joeconway.com> <9c77b6fa-ee88-b2e6-0fa7-4fc81721da35@dunslane.net> <41dcba92-1075-e5e5-cb99-36711abf6cec@dunslane.net> <5c84b70b-ba18-c45d-dbbe-612fa229b2ce@dunslane.net> <398c22f6-4299-4b17-80bf-2f14f4afd592@joeconway.com> In-Reply-To: <398c22f6-4299-4b17-80bf-2f14f4afd592@joeconway.com> From: Davin Shearer Date: Tue, 5 Dec 2023 12:43:31 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Emitting JSON to file using COPY TO To: PostgreSQL-development Cc: Andrew Dunstan , Joe Conway Content-Type: multipart/alternative; boundary="0000000000008d1f06060bc6c67d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000008d1f06060bc6c67d Content-Type: text/plain; charset="UTF-8" Thanks for the wayback machine link Andrew. I read it, understood it, and will comply. Joe, those test cases look great and the outputs are the same as `jq`. As for forward slashes being escaped, I found this: https://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped . Forward slash escaping is optional, so not escaping them in Postgres is okay. The important thing is that the software _reading_ JSON interprets both '\/' and '/' as '/'. --0000000000008d1f06060bc6c67d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for the wayback machine link Andrew.=C2=A0 I read i= t, understood it, and will comply.

Joe, those test cases= look great and the outputs are the same as `jq`.

= As for forward slashes being escaped, I found this:=C2=A0= https://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-es= caped.

Forward slash escaping is optional, so = not escaping them in Postgres is okay. =C2=A0 The important thing is that t= he software _reading_ JSON interprets both '\/' and '/' as = '/'.
--0000000000008d1f06060bc6c67d--