6 |
& eval 'exec perl -S $0 $argv:q' |
& eval 'exec perl -S $0 $argv:q' |
7 |
if 0; |
if 0; |
8 |
|
|
9 |
|
BEGIN { |
10 |
|
my $basedir = $0; $basedir =~ s#/[^/]+$##; |
11 |
|
unshift(@INC, "$basedir/../share"); |
12 |
|
} |
13 |
|
|
14 |
use strict; |
use strict; |
15 |
use Pg; |
use Pg; |
16 |
use Getopt::Long; |
use Getopt::Long; |
17 |
|
use RServ; |
18 |
|
|
19 |
$| = 1; |
$| = 1; |
20 |
|
|
48 |
my $minfo = MkInfo($master,$masterhost,$masterport,$masteruser,$masterpassword); |
my $minfo = MkInfo($master,$masterhost,$masterport,$masteruser,$masterpassword); |
49 |
my $sinfo = MkInfo($slave,$slavehost,$slaveport,$slaveuser,$slavepassword); |
my $sinfo = MkInfo($slave,$slavehost,$slaveport,$slaveuser,$slavepassword); |
50 |
|
|
|
sub RollbackAndQuit { |
|
|
my $conn = shift @_; |
|
|
|
|
|
print STDERR $conn->errorMessage; |
|
|
$conn->exec("ROLLBACK"); |
|
|
exit (-1); |
|
|
} |
|
|
|
|
51 |
# First, lets add the needed information in the slave database |
# First, lets add the needed information in the slave database |
52 |
|
|
53 |
print("Connecting to $sinfo\n") if ($debug || $verbose); |
print("Connecting to $sinfo\n") if ($debug || $verbose); |