Re: \copy combine with SELECT

From: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: \copy combine with SELECT
Date: 2006-03-16 04:40:03
Message-ID: dvaqdf$227e$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


""jia ding"" <dingjia(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Luckys 2006-03-16 04:56:18 Re: hi problem with installing postgresql8.1
Previous Message Chris 2006-03-16 04:26:27 Re: Problems with Postgres and TCP/IP Protocol