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 1r7eGF-0068e7-2D for pgsql-general@arkaria.postgresql.org; Mon, 27 Nov 2023 16:15:03 +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 1r7eGD-00Ewcs-LC for pgsql-general@arkaria.postgresql.org; Mon, 27 Nov 2023 16:15:01 +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 1r7eGD-00Ewcj-8L for pgsql-general@lists.postgresql.org; Mon, 27 Nov 2023 16:15:01 +0000 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r7eGA-007cyj-Pv for pgsql-general@lists.postgresql.org; Mon, 27 Nov 2023 16:15:00 +0000 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3b83fc26e4cso2892564b6e.2 for ; Mon, 27 Nov 2023 08:14:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701101698; x=1701706498; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kmih2BslhMZo6ABAupnnHXEqPi2RV09/B4Yl6qPESeo=; b=FGrbm4BmBLZvmd7UZiERv6xjpEf7U8OqL+K1v9YuPrWBnCnm/w/HMkga0ZvyiJdr4l AQbBnWKZBNNcMNWnwO1MM1iu+l8Bf6z6Zyzkvl11svdxa+8tYP+1ojV2iEetaGB/w2rK njQeotkvW5XxNF23f7w2OnKGI0ddp3JJLVgX+N4R33aOF+oN2rfBNaT1zPaCUytX4yt0 GhAjKbMWd/wtSxjP8O5m2F5ds4Foi+h36PlGj+xdx07Goo02NgGHDjTZWaTHd/WGYN1L pSH19xXYZMM/G54VubdnJpvgiY8BFy1Y0XumnrZZM9znGbCE0rW7wHSNWXIcj7W/8HkW ZUEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701101698; x=1701706498; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kmih2BslhMZo6ABAupnnHXEqPi2RV09/B4Yl6qPESeo=; b=r8dheNQ+8+eMIgiPp4rR340E07Mib3DMjUrGWD0opaU3JimTy7s8GyBZYa81sUTpGV q61zfabCOzjgRGkT2vUw0u+C/TawrqFNEJYhsjBNBA2PECvwgXVxAcQbRLh9y8W0Vzql K8OkVryx7PqWl7HvDCeJAnOlvV6rdenr9KwpGg0EYTg7NgsKmI8rUyYHT+JpQCwW6rrW v4xgLyJdNTEf7FY8erdaNQd2bWZ749FpDwz8IcbXMcTsQoJcA+oMrCYzECEf7SvbkjKl sT//ukGn1RgWDsVVFcx4sdqaGgfbhWGAshtmKB0IqNbuBXyQ/icfNzQtUYmWYlhxNI9o F+Og== X-Gm-Message-State: AOJu0YwmrQlXp/qAu9b5e6oPsKPBqZQoZk7ntv2OAnQ4egW2oV8JxzC/ 8/exWvAL3n2Qa1rrCYU5167/tJeEzdlHNW8mwm4= X-Google-Smtp-Source: AGHT+IHGqvagH0SA7ZmqY0kSHguWJfWSI/UYjVfj2iqCakeASY2aBEjCgaozaEFHrBtxLmZoYwUI71ZgqHWrOiXm81g= X-Received: by 2002:a05:6870:7b4c:b0:1fa:13b6:fc87 with SMTP id ji12-20020a0568707b4c00b001fa13b6fc87mr12594898oab.31.1701101698157; Mon, 27 Nov 2023 08:14:58 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dominique Devienne Date: Mon, 27 Nov 2023 17:14:46 +0100 Message-ID: Subject: Re: Emitting JSON to file using COPY TO To: Adrian Klaver Cc: Davin Shearer , pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000721014060b249aef" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000721014060b249aef Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Nov 27, 2023 at 5:04=E2=80=AFPM Adrian Klaver wrote: > On 11/27/23 01:44, Dominique Devienne wrote: > > On Mon, Nov 27, 2023 at 10:33=E2=80=AFAM 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 eve= n > > a JSON mode. > > Where are you seeing the JSON mode for COPY? AFAIK there is only text > and CSV formats. > Indeed. Somehow I thought there was... I've used the TEXT and BINARY modes, and remembered a wishful thinking JSON mode! OK then, if there was, then what I wrote would apply :). --DD --000000000000721014060b249aef Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Nov 27, 2023 at 5:04=E2=80=AFPM A= drian Klaver <adrian.klaver= @aklaver.com> wrote:
On 11/27/23 01:44, Dominique Devienn= e wrote:
> On Mon, Nov 27, 2023 at 10:33=E2=80=AFAM Dominique Devienne <ddevienne@gmail.com =
> <mailto:dd= evienne@gmail.com>> wrote:
> On second thought, I guess tha= t'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.

Indeed. Somehow I thou= ght there was...
I've used the TEXT and BINARY modes, and rem= embered a wishful thinking JSON mode!
OK then, if there was, then= what I wrote would apply :). --DD
--000000000000721014060b249aef--