Re: csv format for psql

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, Daniel Verite <daniel@manitou-mail.org>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2018-03-09T07:40:40Z
Lists: pgsql-hackers
>>> About "fieldsep_csv", I do not like much the principle of having 
>>> different output variables to represent the same concept depending on 
>>> the format. I would rather have reused fieldsep as in your previous 
>>> submission and set it to "," when under --csv.
>>
>> yes
>>
>
> how will be possible to set different separator ';'? I don't see it with
> described design

Indeed, it should be possible. I think that the following should be made 
to work:

   psql --csv -P fieldsep=; -c 'TABLE foo' > foo.csv

So that it can be changed the semi-colon (or tab or whatever) style if 
required.

-- 
Fabien.


Commits

  1. Add CSV table output mode in psql.

  2. Reorganize format options of psql in alphabetical order

  3. Complete TODO item: