Re: pg_dump with select command

Поиск
Список
Период
Сортировка
От Ondrej Ivanič
Тема Re: pg_dump with select command
Дата
Msg-id CAM6mie+8hZPyaXCGgHTwS3=ECzwkLyLn99R4LEtkXgUG7+yNnA@mail.gmail.com
обсуждение исходный текст
Ответ на pg_dump with select command  (Adarsh Sharma <adarsh.sharma@orkash.com>)
Список pgsql-general
Hi,


On 12 September 2011 15:03, Adarsh Sharma <adarsh.sharma@orkash.com> 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@gmail.com)

В списке pgsql-general по дате отправления:

Предыдущее
От: "Rogel Nocedo"
Дата:
Сообщение: servoy-postgresql plugin
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: servoy-postgresql plugin