Re: Re: csv format for psql

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: Re: csv format for psql
Дата
Msg-id 28bc49a8-99f4-4752-b45d-198b58f9ccf0@manitou-mail.org
обсуждение исходный текст
Ответ на Re: Re: csv format for psql  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Re: csv format for psql  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
    Pavel Stehule wrote:

> implemented in attached patch

Consider your initial output of \pset, when no option is specified
=================
$ ./psql
psql (11devel)
Type "help" for help.

postgres=# \pset
border             1
columns          0
expanded         off
fieldsep         not used
fieldsep_zero         ERROR
footer             on
format             aligned
linestyle         ascii
null             ''
numericlocale         off
pager             1
pager_min_lines      0
recordsep         '\n'
recordsep_zero         off
reset             ERROR
tableattr
title
tuples_only         off
unicode_border_linestyle single
unicode_column_linestyle single
unicode_header_linestyle single
================

These entries with ERROR correspond in fact to no error at all,
or we have to pretend that the default state of psql is erroneous,
which doesn't make sense.

Also "reset" is not a variable, it seems to be a command,
so it probably shouldn't be there in the first place.

More generally, I'd think the point of reusing "fieldsep" was to
reuse the concept, not reimplement it, let alone changing
bits of behavior of the unaligned mode along the way.

With this patch, again without specifying any option, just looking
at what fieldsep is leads to this:

postgres=# \pset fieldsep
User didn't specified field separator.
Current format doesn't specify default field separator.

If this is the way to "solve" the fact that a user has to do
 \pset fieldsep ','
to get commas in csv mode, then IMV the proposed solution
is clearly worse than the stated problem, and worse than
simply adding fieldsep_csv to be independant from the
unaligned mode.


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


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

Предыдущее
От: Haribabu Kommi
Дата:
Сообщение: Re: PQHost() undefined behavior if connecting string contains bothhost and hostaddr types
Следующее
От: Damir Simunic
Дата:
Сообщение: Re: Proposal: http2 wire format