Re: proposal \gcsv

From: Erik Rijkers <er(at)xs4all(dot)nl>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Vik Fearing <vik(at)postgresfriends(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal \gcsv
Date: 2020-03-26 18:41:45
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2020-03-26 18:49, Pavel Stehule wrote:
> Hi
> [psql-gfmt.patch]

This seems useful and works well; I haven't found any errors. Well done.

However, I have a suggestion that is perhaps slightly outside of this
patch but functionally so close that maybe we can discuss it here.

When you try to get a tab-separated output via this new \gfmt in a
you're still forced to use
\pset csv_fieldsep '\t'

Would it be possible to do one of the following to enable a more compact
one-liner syntax:

1. add an option:
\gfmt tsv --> use a TAB instead of a comma in the csv


2. let the psql command-line option '--csv' honour the value given by
psql -F/--field-separator (it does not do so now)


3. add an psql -commandline option:

Any of these three (I'd prefer the first) would make producing a tsv in
shell one-liners with psql easier/more compact.


Erik Rijkers

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2020-03-26 18:49:47 Re: plan cache overhead on plpgsql expression
Previous Message Tom Lane 2020-03-26 18:37:59 Re: plan cache overhead on plpgsql expression