How to do pg_dump + pg_restore within Perl script? - Mailing list pgsql-general

From Kynn Jones
Subject How to do pg_dump + pg_restore within Perl script?
Date
Msg-id AANLkTil86SHMcdCjVuOEam-QVEJMxXBFRbyr_7f32kVk@mail.gmail.com
Whole thread Raw
Responses Re: How to do pg_dump + pg_restore within Perl script?  ("Greg Sabino Mullane" <greg@turnstep.com>)
List pgsql-general
I would like to replicate the following Unix pipe within a Perl script, perhaps using DBD::Pg:

% pg_dump -Z9 -Fc -U <DB_USER> <FROM_DB> | pg_restore -v -d <TO_DB> -p <SSH_TUNNEL_PORT> -h localhost -U <DB_USER>

Of course, I can try to use Perl's system, and the like, to run this pipe verbatim, but I this as a last-resort approach.

Is there a more direct way?

Thanks!

~K

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: peer-to-peer replication with Postgres
Next
From: Daniel Scott
Date:
Subject: PostgreSQL 9.0 - support for RANGE value PRECEDING window functions