Dave Rolsky > Pg-CLI > Pg::CLI::pg_dump

Download:
Pg-CLI-0.11.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.11   Source  

NAME ^

Pg::CLI::pg_dump - Wrapper for the pg_dump utility

VERSION ^

version 0.11

SYNOPSIS ^

  my $pg_dump = Pg::CLI::pg_dump->new(
      username => 'foo',
      password => 'bar',
      host     => 'pg.example.com',
      port     => 5433,
  );

  $pg_dump->run(
      database => 'database',
      options  => [ '-C' ],
  );

  my $sql;
  $pg_dump->run(
      database => 'database',
      options  => [ '-C' ],
      stdout   => \$sql,
  );

DESCRIPTION ^

This class provides a wrapper for the pg_dump utility.

METHODS ^

This class provides the following methods:

Pg::CLI::pg_dump->new( ... )

The constructor accepts a number of parameters:

$pg_dump->run( database => ..., options => [ ... ] )

This method dumps the specified database. Any values passed in options will be passed on to pg_dump.

This method also accepts optional stdin, stdout, and stderr parameters. These parameters can be any defined value that could be passed as the relevant parameter to IPC::Run3's run3 subroutine.

Notably, you can capture the dump output in a scalar reference for the stdout output.

$pg_dump->version()

Returns a the three part version as a string.

$pg_dump->two_part_version()

Returns the first two decimal numbers in the version.

BUGS ^

See Pg::CLI for bug reporting details.

AUTHOR ^

Dave Rolsky <autarch@urth.org>

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)
syntax highlighting: