Re: Copying data from one table of one database to other table f other database - Mailing list pgsql-novice

From Jasen Betts
Subject Re: Copying data from one table of one database to other table f other database
Date
Msg-id gt9h3r$ud3$1@reversiblemaps.ath.cx
Whole thread Raw
In response to Copying data from one table of one database to other table f other database  ("Preetam Palwe" <preetamp@aftek.com>)
List pgsql-novice
On 2009-04-28, Preetam Palwe <preetamp@aftek.com> wrote:
> Thanks folks!
> Following command worked for me
>
>
> psql -h x.x.x.x -U postgres -d securez -c " copy  alerts to stdout "  |
> psql -h x.x.x.x -U postgres -d p -c " copy alerts from stdin "
>
> but
> psql -h x.x.x.x -U postgres -d securez -c " copy (select * from alerts)
> to stdout "  | psql -h x.x.x.x -U postgres -d p -c " copy alerts from
> stdin "
>
> is giving me syntax error as
>
> ERROR:  syntax error at or near "("
> LINE 1:  copy (select * from alerts) to stdout
>
> Any idea ?

That syntax needs version 8.3, I usually do it that way, but with a where
clause in the select as most times I don't want the whole table.


pgsql-novice by date:

Previous
From: Sean Davis
Date:
Subject: Re: retrieving primary key for row with MIN function
Next
From: Marcin Krol
Date:
Subject: Re: retrieving primary key for row with MIN function