Re: Emitting JSON to file using COPY TO

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>
Cc: Sehrope Sarkuni <sehrope(at)jackdb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Davin Shearer <davin(at)apache(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Emitting JSON to file using COPY TO
Date: 2023-12-07 13:19:19
Message-ID: c73dc5ff-7b75-9faf-8534-9b214f214734@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


On 2023-12-06 We 17:56, David G. Johnston wrote:
> On Wed, Dec 6, 2023 at 3:38 PM Joe Conway <mail(at)joeconway(dot)com> wrote:
>
> So the questions are:
> 1. Do those two formats work for the initial implementation?
>
>
> Yes.  We provide a stream-oriented format and one atomic-import format.
>
> 2. Is the default correct or should it be switched
>     e.g. rather than specifying FORCE_ARRAY to get an
>     array, something like FORCE_NO_ARRAY to get JSON lines
>     and the JSON array is default?
>
>
> No default?
>
> Require explicit of a sub-format when the main format is JSON.
>
> JSON_OBJECT_ROWS
> JSON_ARRAY_OF_OBJECTS
>
> For a future compact array-structured-composites sub-format:
> JSON_ARRAY_OF_ARRAYS
> JSON_ARRAY_ROWS
>
>

No default seems unlike the way we treat other COPY options. I'm not
terribly fussed about which format to have as the default, but I think
we should have one.

cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Verite 2023-12-07 13:35:52 Re: Emitting JSON to file using COPY TO
Previous Message Daniel Gustafsson 2023-12-07 13:04:05 Re: Trainning and Certification

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeevan Chalke 2023-12-07 13:24:31 Re: More new SQL/JSON item methods
Previous Message Zhijie Hou (Fujitsu) 2023-12-07 13:00:35 RE: Forbid the use of invalidated physical slots in streaming replication.