Re: Emitting JSON to file using COPY TO
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Dominique Devienne <ddevienne@gmail.com>,
Adrian Klaver <adrian.klaver@aklaver.com>,
Davin Shearer <scholarsmate@gmail.com>,
"pgsql-general@lists.postgresql.org"
<pgsql-general@lists.postgresql.org>
Date: 2023-11-27T14:56:22Z
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 →
-
Add option force_array for COPY JSON FORMAT
- 4c0390ac53b7 19 (unreleased) landed
-
json format for COPY TO
- 7dadd38cda95 19 (unreleased) landed
-
introduce CopyFormat, refactor CopyFormatOptions
- a2145605ee3d 19 (unreleased) landed
-
Doc: add IDs to copy.sgml's <varlistentry> and <refsect1>
- e4018f891dec 19 (unreleased) cited
"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