Re: Field Separator setting not used.

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Field Separator setting not used.
Дата
Msg-id Pine.LNX.4.21.0010172302300.9649-100000@peter.localdomain
обсуждение исходный текст
Ответ на Field Separator setting not used.  (pgsql-bugs@postgresql.org)
Список pgsql-bugs
pgsql-bugs@postgresql.org writes:

> psql -t -q -d servicedesk -F '###' -c "select * from users"
>
> The output should be along the lines of:
>
> abc123###Kevin###Colagio###820###209###x56469
>
> Which is then parsed by a perl program...but instead, it comes up as:
>
> abc123 | Kevin | Colagio | 820 | 209 | x56469

You need to set the output mode to unaligned, e.g., using the -A option.

Quoth the documentation:

       \pset parameter [ value ]

       ...
              format Sets the output format to one of  unaligned,
                     aligned,  html,  or latex.  Unique abbrevia­
                     tions are allowed. (That would mean one let­
                     ter is enough.)

                     ``Unaligned''  writes  all fields of a tuple
                     on a line, separated by the currently active
                     field  separator. This is intended to create
                     output that might be intended to be read  in
                     by other programs (tab-separated, comma-sep­
                     arated).
       ...
              fieldsep
                     Specifies the field separator to be used  in
                     unaligned output mode. That way one can cre­
                     ate, for example,  tab-  or  comma-separated
                     output,  which  other programs might prefer.


--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/

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

Предыдущее
От: Nishad Prakash
Дата:
Сообщение: Re: UPPER and LOWER dosen't work correctly on special caracters (umlauts)
Следующее
От: "Tom Rogers"
Дата:
Сообщение: Bugs in to_char function