Search Postgresql Archives

Re: \copy combine with SELECT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



""jia ding"" <dingjia@xxxxxxxxx> 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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux