Re: csv format for psql

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: csv format for psql
Дата
Msg-id 4b5ab370-ea2a-3911-60a4-407c76e85422@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: csv format for psql  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: csv format for psql  ("Jonathan S. Katz" <jkatz@postgresql.org>)
Re: csv format for psql  ("Daniel Verite" <daniel@manitou-mail.org>)
Список pgsql-hackers
On 4/1/18 03:27, Pavel Stehule wrote:
> I don't share option so CSV format should be exactly same like CSV COPY.
> COPY is designed for backups - and header is not too important there.
> When I seen some csv, then there usually header was used.

I think in practice a lot of people use COPY also because it's a nice
way to get CSV output, even if it's not for backups.  The options that
COPY has for CSV are clearly designed around making the output
compatible with various CSV-variants.  If we create another way to do
CSV in psql, it would be totally confusing if some of the options are
the same and some are different or missing.

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 = , ?

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Edmund Horner
Дата:
Сообщение: Re: PATCH: psql tab completion for SELECT
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS