Re: Emitting JSON to file using COPY TO
Junwang Zhao <zhjwpku@gmail.com>
From: Junwang Zhao <zhjwpku@gmail.com>
To: jian he <jian.universality@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>, Joe Conway <mail@joeconway.com>, Daniel Verite <daniel@manitou-mail.org>,
Andrew Dunstan <andrew@dunslane.net>, Davin Shearer <davin@apache.org>,
PostgreSQL-development <pgsql-hackers@postgresql.org>, Sutou Kouhei <kou@clear-code.com>
Date: 2024-01-27T05:55:23Z
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
Attachments
- v8-0004-Add-support-for-implementing-custom-COPY-TO-forma.patch (application/octet-stream) patch v8-0004
- v8-0003-Export-CopyToStateData.patch (application/octet-stream) patch v8-0003
- v8-0001-Extract-COPY-TO-format-implementations.patch (application/octet-stream) patch v8-0001
- v8-0002-Add-support-for-adding-custom-COPY-TO-format.patch (application/octet-stream) patch v8-0002
- v8-0005-Extract-COPY-FROM-format-implementations.patch (application/octet-stream) patch v8-0005
- v8-0008-Add-support-for-implementing-custom-COPY-FROM-for.patch (application/octet-stream) patch v8-0008
- v8-0007-Export-CopyFromStateData.patch (application/octet-stream) patch v8-0007
- v8-0006-Add-support-for-adding-custom-COPY-FROM-format.patch (application/octet-stream) patch v8-0006
- v8-0009-change-CopyToGetFormat-to-CopyToSendCopyBegin-and.patch (application/octet-stream) patch v8-0009
- v8-0010-introduce-contrib-pg_copy_json.patch (application/octet-stream) patch v8-0010
Hi hackers, Kou-san(CCed) has been working on *Make COPY format extendable[1]*, so I think making *copy to json* based on that work might be the right direction. I write an extension for that purpose, and here is the patch set together with Kou-san's *extendable copy format* implementation: 0001-0009 is the implementation of extendable copy format 00010 is the pg_copy_json extension I also created a PR[2] if anybody likes the github review style. The *extendable copy format* feature is still being developed, I post this email in case the patch set in this thread is committed without knowing the *extendable copy format* feature. I'd like to hear your opinions. [1]: https://www.postgresql.org/message-id/20240124.144936.67229716500876806.kou%40clear-code.com [2]: https://github.com/zhjwpku/postgres/pull/2/files -- Regards Junwang Zhao