Re: Emitting JSON to file using COPY TO - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Emitting JSON to file using COPY TO
Date
Msg-id CAKFQuwaw+n=FBLUXs-jPQbcrvN9Bmgu6eTM-q+GpnHpKBDUsJg@mail.gmail.com
Whole thread Raw
In response to Re: Emitting JSON to file using COPY TO  (Joe Conway <mail@joeconway.com>)
Responses Re: Emitting JSON to file using COPY TO
List pgsql-hackers
On Wed, Dec 6, 2023 at 3:38 PM Joe Conway <mail@joeconway.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

David J.

pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: Emitting JSON to file using COPY TO
Next
From: Joe Conway
Date:
Subject: Re: Emitting JSON to file using COPY TO