Re: 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: Daniel Verite <daniel@manitou-mail.org>, David Steele <david@pgmasters.net>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2018-03-22T17:38:39Z
Lists: pgsql-hackers
Hello Pavel,

> Using \pset format csv means overwriting field sep every time - nobody uses
> |

Yep. The alternative is to have a csv-specific separator variable, which 
does not seem very useful, must be remembered, but this is indeed 
debatable.

> I think so dependency on order of psql arguments is significant problem

This is intentional, and this issue/feature already exists, the last 
argument overwrite previous settings thus will win, eg:

   psql --pset=format=troff --html -c 'SELECT 1'

Will output in html, not in troff.

-- 
Fabien.


Commits

  1. Add CSV table output mode in psql.

  2. Reorganize format options of psql in alphabetical order

  3. Complete TODO item: