Re: csv format for psql - Mailing list pgsql-hackers

From Isaac Morland
Subject Re: csv format for psql
Date
Msg-id CAMsGm5d_xOKHriR72brJkfJSFtPZJ2JEHtk7S6OP_MCfMmNwqw@mail.gmail.com
Whole thread Raw
In response to Re: csv format for psql  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: csv format for psql  (Fabien COELHO <coelho@cri.ensmp.fr>)
Re: csv format for psql  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-hackers
On 31 March 2018 at 04:33, Fabien COELHO <coelho@cri.ensmp.fr> wrote:

Bonjour Daniel,

For csv, Fabien and Peter expressed the opinion that we shouldn't
create another fieldsep-like variable specifically for it, but instead
reuse fieldsep. That's what my latest patch does.

Now it turns out that sharing fieldsep comes with some problems.

Personnaly I do not have any problem with CSV defaulting to '|' separator, given that anyway people often use anything but a comma for the purpose, including '|'.

However Pavel wants to block the patch on this point. Too bad.

OK, mostly trying to avoid commenting because I doubt I have much to add. But. If I ask for CSV and don't specify any overrides, I expect to get "C"omma separated values, not some other character. More specifically, if I say --csv I expect to get files that are identical with what I would get if I used COPY ... CSV. Actually, COPY ... CSV HEADER, given that psql shows column headings. This also implies that I expect the quoting and related details that are associated with CSV.

And I don't think I'm a weird user. If --csv does anything even a little different from a simple COPY invocation on the same query, at some point it's going to bite somebody and they will rightfully curse the design decisions taken in this thread.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Small proposal to improve out-of-memory messages
Next
From: Tom Lane
Date:
Subject: Re: WIP: a way forward on bootstrap data