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 |
|
|
65 |
} |
} |
66 |
print "Using lib '$lib'\n" if ($verbose); |
print "Using lib '$lib'\n" if ($verbose); |
67 |
|
|
|
sub RollbackAndQuit { |
|
|
my $conn = shift @_; |
|
|
|
|
|
print STDERR "Error in query: ", $conn->errorMessage; |
|
|
$conn->exec("ROLLBACK"); |
|
|
exit (-1); |
|
|
} |
|
|
|
|
68 |
my $mconn = Pg::connectdb($minfo); |
my $mconn = Pg::connectdb($minfo); |
69 |
if ($mconn->status != PGRES_CONNECTION_OK) { |
if ($mconn->status != PGRES_CONNECTION_OK) { |
70 |
print STDERR "Failed opening $minfo\n"; |
print STDERR "Failed opening $minfo\n"; |