Re: csv format for psql - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: csv format for psql
Date
Msg-id CAFj8pRCb0MGQKU10hMu6hjwY6B4yCNdR-aFO5Qv2Q11ULC2QWQ@mail.gmail.com
Whole thread Raw
In response to Re: csv format for psql  ("Daniel Verite" <daniel@manitou-mail.org>)
Responses Re: csv format for psql  (David Fetter <david@fetter.org>)
List pgsql-hackers


2018-03-07 21:31 GMT+01:00 Daniel Verite <daniel@manitou-mail.org>:
        David Fetter wrote:

> We have some inconsistency here in that fewer table formats are
> supported, but I think asciidoc, etc., do this correctly via
> invocations like:
>
>    psql -P format=asciidoc -o foo.adoc -AtXc 'TABLE foo'

-A is equivalent to -P format=unaligned, so in the above
invocation, it cancels the effect of -P format=asciidoc.
Anyway -P format=name on the command line
is the same as "\pset format name" as a
metacommand, so it works for all formats.

Some formats (unaligned, html)  have corresponding
command-line options (-A, -H), and others don't.
In this patch, -C is used so that csv would be in the
category of formats that can be switched on with the simpler
invocation on the command line.
If we don't like that, we can leave out -C for future use
and let users write -P format=csv.
That's not the best choice from my POV though, as csv
is a primary choice to export tabular data.

-C can be used for certificates or some similar. I like csv, but I am not sure, so it is too important to get short option (the list of free chars will be only shorter)

Regards

Pavel

 

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

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: FOR EACH ROW triggers on partitioned tables
Next
From: Robert Haas
Date:
Subject: Re: Server won't start with fallback setting by initdb.