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

From Tom Lane
Subject Re: Emitting JSON to file using COPY TO
Date
Msg-id 3853387.1701096982@sss.pgh.pa.us
Whole thread Raw
In response to Re: Emitting JSON to file using COPY TO  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Emitting JSON to file using COPY TO
List pgsql-general
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> I agree there should be a copy option for “not formatted” so if you dump a
> single column result in that format you get the raw unescaped contents of
> the column.

I'm not sure I even buy that.  JSON data in particular is typically
multi-line, so how will you know where the row boundaries are?
That is, is a newline a row separator or part of the data?

You can debate the intelligence of any particular quoting/escaping
scheme, but imagining that you can get away without having one at
all will just create its own problems.

            regards, tom lane



pgsql-general by date:

Previous
From: CG
Date:
Subject: Re: Removing oids with pg_repack
Next
From: Ron Johnson
Date:
Subject: Re: PostgreSql: Canceled on conflict out to old pivot