Re: proposal \gcsv

Vik Fearing <vik@postgresfriends.org>

From: Vik Fearing <vik@postgresfriends.org>
To: Tom Lane <tgl@sss.pgh.pa.us>, Pavel Stehule <pavel.stehule@gmail.com>
Cc: Daniel Verite <daniel@manitou-mail.org>, Erik Rijkers <er@xs4all.nl>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2020-04-01T07:07:26Z
Lists: pgsql-hackers
On 4/1/20 1:53 AM, Tom Lane wrote:
> Consider some syntax along the lines of
> 
> \gpset (pset-option-name [pset-option-value]) ... filename
> 
> or if you don't like parentheses, choose some other punctuation to wrap
> the \pset options in.  I initially thought of square brackets, but I'm
> afraid they might be just too darn confusing to document --- how could
> you make them distinct from metasyntax square brackets, especially in
> plain-ASCII docs?  Also it'd have to be punctuation that's unlikely to
> start a file name --- but parens are already reserved in most shells.


If parens are going to be required, why don't we just add them to \g?

TABLE blah \g (format csv) filename
-- 
Vik Fearing



Commits

  1. Allow psql's \g and \gx commands to transiently change \pset options.