Search Postgresql Archives

Re: pg_dump with select command

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

 



Hi,


On 12 September 2011 15:03, Adarsh Sharma <adarsh.sharma@xxxxxxxxxx> wrote:
> Today I need some part ( subset ) of some tables to another database to a
> remote server.
> I need to take backup of  tables after satisfying a select query.
>
> Is there any option to specify query in pg_dump command.I researched in the
> manual but not able to find that.
> Please let me know if it is possible as we can can specify in mysqldump
> command.

No, pg_dump can dump full tables only. You can use psql:

psql -h <host1> ... -c 'copy (select ... from <tablename> where ...)
to stdout' | psql -h <host2> ...  -c 'copy <tablename> from stdin'

(where '...' are other psql's options like user, db, ...)

-- 
Ondrej Ivanic
(ondrej.ivanic@xxxxxxxxx)

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[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