Re: Emitting JSON to file using COPY TO

Adrian Klaver <adrian.klaver@aklaver.com>

From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: Davin Shearer <scholarsmate@gmail.com>, pgsql-general@lists.postgresql.org
Date: 2023-11-27T16:04:05Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add option force_array for COPY JSON FORMAT

  2. json format for COPY TO

  3. introduce CopyFormat, refactor CopyFormatOptions

  4. Doc: add IDs to copy.sgml's <varlistentry> and <refsect1>

On 11/27/23 01:44, Dominique Devienne wrote:
> On Mon, Nov 27, 2023 at 10:33 AM Dominique Devienne <ddevienne@gmail.com 
> <mailto:ddevienne@gmail.com>> 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