Re: \copy combine with SELECT - Mailing list pgsql-general

From Qingqing Zhou
Subject Re: \copy combine with SELECT
Date
Msg-id dvaqdf$227e$1@news.hub.org
Whole thread Raw
In response to \copy combine with SELECT  ("jia ding" <dingjia@gmail.com>)
List pgsql-general
""jia ding"" <dingjia@gmail.com> wrote

> 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?

Notice that COPY command can be used like this:
COPY <relname> ['(' columnList ')'] FROM/TO [WITH options]

Regards,
Qingqing




pgsql-general by date:

Previous
From: Chris
Date:
Subject: Re: Problems with Postgres and TCP/IP Protocol
Next
From: Luckys
Date:
Subject: Re: hi problem with installing postgresql8.1