Re: csv format for psql

Daniel Verite <daniel@manitou-mail.org>

From: "Daniel Verite" <daniel@manitou-mail.org>
To: "Pavel Stehule" <pavel.stehule@gmail.com>
Cc: "Peter Eisentraut" <peter.eisentraut@2ndquadrant.com>,"Fabien COELHO" <coelho@cri.ensmp.fr>,"Isaac Morland" <isaac.morland@gmail.com>,"David G. Johnston" <david.g.johnston@gmail.com>,"David Steele" <david@pgmasters.net>,"PostgreSQL Hackers" <pgsql-hackers@postgresql.org>
Date: 2018-08-10T10:25:49Z
Lists: pgsql-hackers

Attachments

	Pavel Stehule wrote:

> > On the whole I'm inclined to resubmit the patch with
> > fieldsep_csv and some minor changes based on the rest
> > of the discussion.
> >
> 
> +1

PFA an updated version.
Usage from the command line:
$ psql --csv	      # or -P format=csv
$ psql --csv -P fieldsep_csv=";"  # for non-comma csv separator

From inside psql:

\pset format csv
\pset fieldsep_csv '\t'


Best regards,
-- 
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite

Commits

  1. Add CSV table output mode in psql.

  2. Reorganize format options of psql in alphabetical order

  3. Complete TODO item: