Re: \copy combine with SELECT

Поиск
Список
Период
Сортировка
От Chris
Тема Re: \copy combine with SELECT
Дата
Msg-id 4418A45B.5050200@gmail.com
обсуждение исходный текст
Ответ на \copy combine with SELECT  ("jia ding" <dingjia@gmail.com>)
Ответы Re: \copy combine with SELECT  ("jia ding" <dingjia@gmail.com>)
Список pgsql-general
jia ding wrote:
> Hi all,
>
> I tried:
> select id, name  into table2   from table1;
>  \copy table2 to filename.txt
> in order to export 2 columns from table1 to a file.
>
> But, I am thinking, if there is a command can combine these two command
> together?
> Maybe, something like: \copy select id,name  from table  to filename.txt

Close.

copy tablename field1, field2 to 'filename';

http://www.postgresql.org/docs/8.1/static/sql-copy.html

--
Postgresql & php tutorials
http://www.designmagick.com/

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

Предыдущее
От: Chris
Дата:
Сообщение: Re: catch SELECT statement return
Следующее
От: "Jaime Casanova"
Дата:
Сообщение: Re: Concurrencia