pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Andrew Dunstan <andrew@dunslane.net>
To: Joe Conway <mail@joeconway.com>
To: Davin Shearer <davin@apache.org>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Emitting JSON to file using COPY TO
Date: Wed, 6 Dec 2023 07:36:36 -0500
Message-ID: <2e7ff718-895d-83fc-46f7-be25e23b23b4@dunslane.net> (raw )
In-Reply-To: <7a60faf6-e7f1-419d-aee6-10a78ea2fe81@joeconway.com >
References: <CALvfUkBxTYy5uWPFVwpk_7ii2zgT07t3d-yR_cy4sfrrLU=kcg@mail.gmail.com >
<c30fc5da-0348-4e44-b699-804ccbdcfc36@joeconway.com >
<41dcba92-1075-e5e5-cb99-36711abf6cec@dunslane.net >
<bcbb2a04-5df3-49f2-b304-28ae8edc5189@joeconway.com >
<CALvfUkB2QtG-BXsTwjoLO8ZYUsNFytqjPvZex8stQ0r_qNM7HQ@mail.gmail.com >
<5c84b70b-ba18-c45d-dbbe-612fa229b2ce@dunslane.net >
<CALvfUkDxgTppjy-Q_i2znakMFp2vrJdPUEJNyGTL2LcZBOWV6A@mail.gmail.com >
<cbd65026-d79c-40b1-8be3-10e1db2fc092@joeconway.com >
<398c22f6-4299-4b17-80bf-2f14f4afd592@joeconway.com >
<CALvfUkAbj4Bwg0FjYpvj0-zddcetWg1Sejt=OGBTDskbqOFS_A@mail.gmail.com >
<46cc4507-a0d9-4044-b2ce-5a8bca8015c0@joeconway.com >
<CALvfUkD8+bcNs1cYeU3wK9YsyZ7zUjs2aTxO+++Vq7zKeUE7+w@mail.gmail.com >
<2554e520-e103-8978-dcb5-807dfeb77402@dunslane.net >
<cb1f118c-4698-4451-9ba9-dd8595f06c37@joeconway.com >
<926ff917-8371-40ec-b5e6-ab7b0e09bdc5@joeconway.com >
<315b81d4-4b67-7828-0355-3808cd14acd1@dunslane.net >
<7a60faf6-e7f1-419d-aee6-10a78ea2fe81@joeconway.com >
On 2023-12-05 Tu 16:46, Joe Conway wrote:
> On 12/5/23 16:20, Andrew Dunstan wrote:
>> On 2023-12-05 Tu 16:09, Joe Conway wrote:
>>> On 12/5/23 16:02, Joe Conway wrote:
>>>> On 12/5/23 15:55, Andrew Dunstan wrote:
>>>>> and in any other case (e.g. LINES) I can't see why you
>>>>> would have them.
>>>
>>> Oh I didn't address this -- I saw examples in the interwebs of MSSQL
>>> server I think [1] which had the non-array with commas import and
>>> export style. It was not that tough to support and the code as
>>> written already does it, so why not?
>>
>> That seems quite absurd, TBH. I know we've catered for some absurdity in
>> the CSV code (much of it down to me), so maybe we need to be liberal in
>> what we accept here too. IMNSHO, we should produce either a single JSON
>> document (the ARRAY case) or a series of JSON documents, one per row
>> (the LINES case).
>
>
> So your preference would be to not allow the non-array-with-commas
> case but if/when we implement COPY FROM we would accept that format?
> As in Postel'a law ("be conservative in what you do, be liberal in
> what you accept from others")?
Yes, I think so.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
view thread (163+ messages) latest in thread
Message-ID: <2e7ff718-895d-83fc-46f7-be25e23b23b4@dunslane.net>
Permalink: ../2e7ff718-895d-83fc-46f7-be25e23b23b4@dunslane.net/
Also on: postgresql.org/message-id/2e7ff718-895d-83fc-46f7-be25e23b23b4@dunslane.net
copy link · copy postgr.es
reply 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: andrew@dunslane.net, mail@joeconway.com, davin@apache.org, pgsql-hackers@postgresql.org
Subject: Re: Emitting JSON to file using COPY TO
In-Reply-To: <2e7ff718-895d-83fc-46f7-be25e23b23b4@dunslane.net>
* 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