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