Re: Emitting JSON to file using COPY TO
Andrew Dunstan <andrew@dunslane.net>
From: Andrew Dunstan <andrew@dunslane.net>
To: Joe Conway <mail@joeconway.com>, jian he <jian.universality@gmail.com>,
Junwang Zhao <zhjwpku@gmail.com>
Cc: Florents Tselai <florents.tselai@gmail.com>,
"Andrey M. Borodin" <x4mmm@yandex-team.ru>,
Dean Rasheed <dean.a.rasheed@gmail.com>,
Daniel Verite <daniel@manitou-mail.org>, Davin Shearer <davin@apache.org>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2026-03-05T20:49:55Z
Lists: pgsql-hackers, pgsql-general
Attachments
- v25-0001-introduce-CopyFormat-refactor-CopyFormatOptions.patch (text/x-patch) patch v25-0001
- v25-0002-json-format-for-COPY-TO.patch (text/x-patch) patch v25-0002
- v25-0003-Add-option-force_array-for-COPY-JSON-FORMAT.patch (text/x-patch) patch v25-0003
- v25-0004-COPY-TO-JSON-build-JSON-per-column-support-colum.patch (text/x-patch) patch v25-0004
> On 2026-03-05 Th 1:06 PM, Joe Conway wrote: >> >> >> Then I reworked the way this works. In order to support column lists >> with JSON output, we need to deal with individual columns instead of >> whole records. This involved quite a number of changes, as can be >> seen in patch 4. This involved exporting a new small function from >> json.c. >> >> The result is a lot cleaner, I believe, and in my benchmarking is >> faster by a factor of almost 2. > > Andrew, > > I don't see the actual patches. Did I miss it somewhere? Nope. Bad hair day apparently. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com
Commits
-
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
-
Refactor COPY TO to use format callback functions.
- 2e4127b6d2d8 18.0 cited