Re: Emitting JSON to file using COPY TO

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Daniel Verite <daniel(at)manitou-mail(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, 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: 2024-11-19 06:16:52
Message-ID: CACJufxH8J0uD-inukxAmd3TVwt-b-y7d7hLGSBdEdLXFGJLyDA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

hi. there.

new patch attached.
v13-00001 is from
https://postgr.es/m/fbc63db8-94de-45f6-b327-50456630264d@app.fastmail.com
just refactoring copy format.
The author is Joel Jacobson!

v13-0002, v13-0003 almost the same as previously v12.
some minor change compared to v12:
* refactor code, based on v13-0001. instead of a bool in
CopyFormatOptions-> json_mode

now we use
typedef enum CopyFormat
{
COPY_FORMAT_TEXT = 0,
COPY_FORMAT_BINARY,
COPY_FORMAT_CSV,
COPY_FORMAT_JSON,
} CopyFormat;
to represent the format of the COPY operation.

* make JSON format cannot be used with {default, null, delimiter}
options. and add related tests, documentation.

* add tab_complete

Attachment Content-Type Size
v13-0002-introduce-json-format-for-COPY-TO.patch text/x-patch 16.6 KB
v13-0003-Add-option-force_array-for-COPY-JSON-FORMAT.patch text/x-patch 8.9 KB
v13-0001-Introduce-CopyFormat-and-replace-csv_mode-and-bi.patch text/x-patch 18.8 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message 張宸瑋 2024-11-19 08:40:46 Re: Re : Credcheck extension
Previous Message David G. Johnston 2024-11-18 21:27:29 Re: Default session role broken in PostgreSQL 14.14?

Browse pgsql-hackers by date

  From Date Subject
Next Message Will Mortensen 2024-11-19 06:45:12 README.tuplock and SHARE lock
Previous Message Laurenz Albe 2024-11-19 05:56:34 Re: UNION versus collations