Re: csv format for psql

From: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Daniel Verite <daniel(at)manitou-mail(dot)org>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, David Steele <david(at)pgmasters(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: csv format for psql
Date: 2018-03-31 15:22:43
Message-ID: CAMsGm5d_xOKHriR72brJkfJSFtPZJ2JEHtk7S6OP_MCfMmNwqw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 31 March 2018 at 04:33, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-03-31 15:25:23 Re: WIP: a way forward on bootstrap data
Previous Message Tom Lane 2018-03-31 15:08:38 Re: Small proposal to improve out-of-memory messages