9 |
use strict; |
use strict; |
10 |
use Pg; |
use Pg; |
11 |
use Getopt::Long; |
use Getopt::Long; |
|
use Sys::Hostname; |
|
12 |
|
|
13 |
$| = 1; |
$| = 1; |
14 |
|
|
93 |
# exit 1; |
# exit 1; |
94 |
} |
} |
95 |
|
|
96 |
my $host = defined($slavehost) ? $slavehost : hostname; |
$slavehost="localhost" if (! $slavehost); |
97 |
|
|
98 |
$result = $mconn->exec("INSERT INTO _RSERV_SERVERS_ (host,dbase) VALUES ('$host','$slave')"); |
$result = $mconn->exec("INSERT INTO _RSERV_SERVERS_ (host,dbase) VALUES ('$slavehost','$slave')"); |
99 |
if ($result->resultStatus ne PGRES_COMMAND_OK) { |
if ($result->resultStatus ne PGRES_COMMAND_OK) { |
100 |
print STDERR $mconn->errorMessage; |
print STDERR $mconn->errorMessage; |
101 |
RollbackAndQuit($conn) if ($result->resultStatus ne PGRES_COMMAND_OK); |
RollbackAndQuit($conn) if ($result->resultStatus ne PGRES_COMMAND_OK); |