- COPYRIGHT AND LICENSE
Pg::CLI::pg_restore - Wrapper for the pg_restore utility
my $pg_restore = Pg::CLI::pg_restore->new( username => 'foo', password => 'bar', host => 'pg.example.com', port => 5433, ); $pg_restore->run( database => 'database', options => [ '-C' ], ); my $sql; $pg_restore->run( database => 'database', options => ['-C'], stdin => \$sql, );
This class provides a wrapper for the pg_restore utility.
This class provides the following methods:
Pg::CLI::pg_restore->new( ... )
The constructor accepts a number of parameters:
The path to pg_restore. By default, this will look for pg_restore in your path and throw an error if it cannot be found.
The username to use when connecting to the database. Optional.
The password to use when connecting to the database. Optional.
The host to use when connecting to the database. Optional.
The port to use when connecting to the database. Optional.
If this is true, then the
PGSSLMODEenvironment variable will be set to "require" when connecting to the database.
$pg_restore->run( database => ..., options => [ ... ] )
This method restores the specified database. Any values passed in
options will be passed on to pg_restore.
This method also accepts optional
stderr parameters. These parameters can be any defined value that could be passed as the relevant parameter to IPC::Run3's
Notably, you can capture the restore output in a scalar reference for the
Returns a the three part version as a string.
Returns the first two decimal numbers in the version.
See Pg::CLI for bug reporting details.
Dave Rolsky <email@example.com>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2013 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)