Re: copy query results to file

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: copy query results to file
Дата
Msg-id jc9nca$20f$1@dough.gmane.org
обсуждение исходный текст
Ответ на copy query results to file  ("John Payne" <jcpayne@uw.edu>)
Ответы Re: copy query results to file  (Michael Wood <esiotrot@gmail.com>)
Список pgsql-novice
John Payne, 14.12.2011 02:49:
> 2.Use psql to output the data, as in:
>
> a.\o
>
> b.Query here….
>
> c.\o
>
> The psql produces output in an inconvenient format with pipe symbols and headers and underlines.

You can use the options:

\t
\a
\pset fieldsep ,

to get a more "CSV" like output in psql. If you want a tab character as the field delimiter, you can use:

\pset fieldsep '\t'

So the whole thing would be:

\a
\t
\pset fieldsep ,
\o

SELECT ...

\o

Thomas


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

Предыдущее
От: Pandu Poluan
Дата:
Сообщение: Re: copy query results to file
Следующее
От: Michael Wood
Дата:
Сообщение: Re: copy query results to file