Re: csv format for psql

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: csv format for psql
Дата
Msg-id b8f3dd78-4474-4cf7-b76d-14c6bf500e70@manitou-mail.org
обсуждение исходный текст
Ответ на Re: csv format for psql  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: csv format for psql  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: csv format for psql  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
    Peter Eisentraut wrote:

> Another thought: Isn't CSV just the same as unaligned output plus some
> quoting?  Could we add a quote character setting and then define --csv
> to be quote-character = " and fieldsep = , ?

Plus footer set to off. So --csv would be like
\pset format unaligned
\pset fieldsep ','
\pset footer off
\pset unaligned_quote_character '"'

I guess we'd add a \csv command that does these together.

There would still be some discomfort with some of the issues
discussed upthread. For instance
  psql -F ';' --csv
is likely to reset fieldsep to ',' having then a different outcome than
  psql --csv -F';'

And there's the point on how to come back from \csv to another
output, given that it has overwritten "footer" that is used across
all formats, and fieldsep used by unaligned.
So a user might need to figure out anyway the
intricaties behind \csv, if it's not an independant format.

On the whole I'm inclined to resubmit the patch with
fieldsep_csv and some minor changes based on the rest
of the discussion.

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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: csv format for psql
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Mop-up for the bootstrap data conversion patch