Hello Daniel,
> 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'
Patch applies cleanly, compiles, global make check ok.
Doc: "according to the csv rules" -> "according to csv rules."?
Doc: "RFC-4180" -> "RFC 4180"?
The previous RFC specifies CRLF as eol, but '\n' is hardcoded in the
source. I'm fine with that, but I'd suggest that the documentation should
said which EOL is used.
ISTM that "--csv" & "-C" are not documented, neither in sgml nor under
--help.
"fieldsep_csv" does not show on the list of output options under "\?".
There seems to be a test in the code to set an empty string "" by default,
but it is unclear to me when this is triggered.
I'd tend to use "CSV" instead of "csv" everywhere it makes sense, eg in
the doc (CSV rules) and in variable names in the code (FooCsv -> FooCSV?),
but that is pretty debatable.
--
Fabien.