pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Dominique Devienne <ddevienne@gmail.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Davin Shearer <scholarsmate@gmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Emitting JSON to file using COPY TO
Date: Mon, 27 Nov 2023 09:56:22 -0500
Message-ID: <3853387.1701096982@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwZb3zaSqkOvGXRRLZEW61az+4xyHZ7tBPR91JfrcdCKvA@mail.gmail.com>
References: <CALvfUkBxTYy5uWPFVwpk_7ii2zgT07t3d-yR_cy4sfrrLU=kcg@mail.gmail.com>
	<fc1e39f8-274f-4be6-8a70-9fb0d9fe84a2@aklaver.com>
	<CAFCRh-_LhP5Ln4-beVz=1pQ9VycU3hAxnJHXhPHZRmX0BSCVEQ@mail.gmail.com>
	<CAFCRh--Vhx0105S7SWAYHGcVMTSRtbcoArDUGSbYSWRUGunW_g@mail.gmail.com>
	<CAKFQuwZb3zaSqkOvGXRRLZEW61az+4xyHZ7tBPR91JfrcdCKvA@mail.gmail.com>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> I agree there should be a copy option for “not formatted” so if you dump a
> single column result in that format you get the raw unescaped contents of
> the column.

I'm not sure I even buy that.  JSON data in particular is typically
multi-line, so how will you know where the row boundaries are?
That is, is a newline a row separator or part of the data?

You can debate the intelligence of any particular quoting/escaping
scheme, but imagining that you can get away without having one at
all will just create its own problems.

			regards, tom lane





view thread (163+ messages)  latest in thread

Message-ID: <3853387.1701096982@sss.pgh.pa.us>
Permalink:  ../3853387.1701096982@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3853387.1701096982@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, ddevienne@gmail.com, adrian.klaver@aklaver.com, scholarsmate@gmail.com, pgsql-general@lists.postgresql.org
  Subject: Re: Emitting JSON to file using COPY TO
  In-Reply-To: <3853387.1701096982@sss.pgh.pa.us>

* 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