1 |
# -*- perl -*- |
#!/usr/bin/perl |
2 |
# ApplySnapshot |
# ApplySnapshot |
3 |
# Vadim Mikheev, (c) 2000, PostgreSQL Inc. |
# Vadim Mikheev, (c) 2000, PostgreSQL Inc. |
4 |
|
|
6 |
& eval 'exec perl -S $0 $argv:q' |
& eval 'exec perl -S $0 $argv:q' |
7 |
if 0; |
if 0; |
8 |
|
|
9 |
use lib "@LIBDIR@"; |
use lib "/usr/share/postgresql/contrib"; |
10 |
use IO::File; |
use IO::File; |
11 |
use RServ; |
use RServ; |
12 |
use Getopt::Long; |
use Getopt::Long; |
32 |
$sinfo = "$sinfo user=$opt_user" if (defined($opt_user)); |
$sinfo = "$sinfo user=$opt_user" if (defined($opt_user)); |
33 |
$sinfo = "$sinfo password=$opt_password" if (defined($opt_password)); |
$sinfo = "$sinfo password=$opt_password" if (defined($opt_password)); |
34 |
|
|
35 |
my $conn = Pg::connectdb(sinfo); |
my $conn = Pg::connectdb($sinfo); |
36 |
|
|
37 |
my $inpf = new IO::File; |
my $inpf = new IO::File; |
38 |
$inpf = STDIN; |
$inpf = STDIN; |
39 |
|
|
40 |
|
$RServ::quiet = !$verbose; |
41 |
|
|
42 |
$res = ApplySnapshot ($conn, $inpf); |
$res = ApplySnapshot ($conn, $inpf); |
43 |
|
|
44 |
if ($res > 0) |
if ($res > 0) |