From: Joe Conway <mail@joeconway.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Daniel Verite <daniel@manitou-mail.org>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Davin Shearer <davin@apache.org>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Emitting JSON to file using COPY TO
Date: Wed, 6 Dec 2023 20:14:09 -0500
Message-ID: <6d8baa96-1c7c-4fa9-a49a-57f7393fcf08@joeconway.com> (raw)
In-Reply-To: <CAKFQuwY7k5g0MFgjTm20=irAiUpTSxLBpmUgMinj-igVVM+avA@mail.gmail.com>
References: <b3a73eca-ec3b-4b64-b6c2-82418bb16701@manitou-mail.org>
<b7d8c88b-d175-44ca-a323-ec2f5c3cd37d@joeconway.com>
<8620df11-96e4-4ca3-8f3c-33a479260961@joeconway.com>
<CAKFQuwYS4HwypV3iKqx+GdsMU+-k-VTWt4bu6vc5nYqcAMgkcA@mail.gmail.com>
<64c24dab-cf4b-4c33-8667-540136588e9e@joeconway.com>
<CAKFQuwZeA3LdG=XpeTy1oPAXgPYK5aaRDRYPv4jNFMszD2RnyA@mail.gmail.com>
<63119a48-07aa-4cab-9383-91a24b7b54cd@joeconway.com>
<CAKFQuwY7k5g0MFgjTm20=irAiUpTSxLBpmUgMinj-igVVM+avA@mail.gmail.com>
On 12/6/23 20:09, David G. Johnston wrote:
> On Wed, Dec 6, 2023 at 5:57 PM Joe Conway <mail@joeconway.com
> <mailto:mail@joeconway.com>> wrote:
>
> On 12/6/23 19:39, David G. Johnston wrote:
> > On Wed, Dec 6, 2023 at 4:45 PM Joe Conway <mail@joeconway.com
> <mailto:mail@joeconway.com>
> > <mailto:mail@joeconway.com <mailto:mail@joeconway.com>>> wrote:
>
> > But I still cannot shake the belief that using a format code of 1 -
> > which really could be interpreted as meaning "textual csv" in
> practice -
> > for this JSON output is unwise and we should introduce a new integer
> > value for the new fundamental output format.
>
> No, I am pretty sure you still have that wrong. The "1" means binary
> mode
>
>
> Ok. I made the same typo twice, I did mean to write 0 instead of 1.
Fair enough.
> But the point that we should introduce a 2 still stands. The new code
> would mean: use text output functions but that there is no inherent
> tabular structure in the underlying contents. Instead the copy format
> was JSON and the output layout is dependent upon the json options in the
> copy command and that there really shouldn't be any attempt to turn the
> contents directly into a tabular data structure like you presently do
> with the CSV data under format 0. Ignore the column count and column
> formats as they are fixed or non-existent.
I think that amounts to a protocol change, which we tend to avoid at all
costs.
--
Joe Conway
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-general@postgresql.org
Cc: mail@joeconway.com, david.g.johnston@gmail.com, daniel@manitou-mail.org, andrew@dunslane.net, davin@apache.org, pgsql-hackers@postgresql.org
Subject: Re: Emitting JSON to file using COPY TO
In-Reply-To: <6d8baa96-1c7c-4fa9-a49a-57f7393fcf08@joeconway.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox