\copy combine with SELECT

From: "jia ding" <dingjia(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: \copy combine with SELECT
Date: 2006-03-14 13:26:49
Message-ID: 91ae6e350603140526v527c8424ibe25e87c9964e7d2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

?

Nina

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Hallgren 2006-03-14 13:32:10 Re: Clustered PostgreSQL
Previous Message Louis Gonzales 2006-03-14 13:26:48 Re: Clustered PostgreSQL