Re: dumping query results to a csv

Поиск
Список
Период
Сортировка
От Adi Alurkar
Тема Re: dumping query results to a csv
Дата
Msg-id 8F4C1563-3FF3-419A-8156-41878BEEB890@sf.net
обсуждение исходный текст
Ответ на dumping query results to a csv  (David Durham <ddurham@vailsys.com>)
Ответы Re: dumping query results to a csv  ("Jim C. Nasby" <jnasby@pervasive.com>)
Re: dumping query results to a csv  (David Durham <ddurham@vailsys.com>)
Список pgsql-admin
Greetings,

There is no direct way to achieve what you want, the easiest hack is
to create a temp table with you query i.e.

create table tmp_foo as select col1, col4, col7 from table1, table2
where  ....;
copy table tmp_foo to [stdout|<file_name>]

HTH

Adi Alurkar
adi@sf.net


On Aug 25, 2005, at 3:24 PM, David Durham wrote:

> This is kind of a pg-admin newbie question, so apologies in advance.
>
> Anyway, I'd like to issue a command that dumps the results of a
> query to
> a txt file in comma delimited format.  Does PostgreSQL ship with
> something to do this?  I searched the web, but found what appeared
> to be
> non-free solutions.
>
> Thanks,
>
> Dave
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>


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

Предыдущее
От: Jeff Frost
Дата:
Сообщение: Re: dumping query results to a csv
Следующее
От: Jeff Frost
Дата:
Сообщение: Re: dumping query results to a csv