@ -1,3 +1,4 @@
= pod
= head1 NAME
@ -106,10 +107,7 @@ of finding port numbers, registering instances for cleanup, etc.
sub new
{
my $ class = shift ;
my $ name = shift ;
my $ pghost = shift ;
my $ pgport = shift ;
my ( $ class , $ name , $ pghost , $ pgport ) = @ _ ;
my $ testname = basename ( $ 0 ) ;
$ testname =~ s/\.[^.]+$// ;
my $ self = {
@ -607,8 +605,7 @@ sub promote
my $ logfile = $ self - > logfile ;
my $ name = $ self - > name ;
print "### Promoting node \"$name\"\n" ;
TestLib:: system_log ( 'pg_ctl' , '-D' , $ pgdata , '-l' , $ logfile ,
'promote' ) ;
TestLib:: system_log ( 'pg_ctl' , '-D' , $ pgdata , '-l' , $ logfile , 'promote' ) ;
}
# Internal routine to enable streaming replication on a standby node.
@ -619,7 +616,8 @@ sub enable_streaming
my $ name = $ self - > name ;
print "### Enabling streaming replication for node \"$name\"\n" ;
$ self - > append_conf ( 'recovery.conf' , qq(
$ self - > append_conf (
'recovery.conf' , qq(
primary_conninfo = '$root_connstr application_name=$name'
standby_mode = on
) ) ;
@ -641,11 +639,13 @@ sub enable_restoring
# first. Paths also need to be double-quoted to prevent failures where
# the path contains spaces.
$ path =~ s{\\} {\\\\}g if ( $ TestLib:: windows_os ) ;
my $ copy_command = $ TestLib:: windows_os ?
qq{ copy "$path \\ \\ %f" "%p" } :
qq{ cp $path/%f %p } ;
my $ copy_command =
$ TestLib:: windows_os
? qq{ copy "$path \\ \\ %f" "%p" }
: qq{ cp $path/%f %p } ;
$ self - > append_conf ( 'recovery.conf' , qq(
$ self - > append_conf (
'recovery.conf' , qq(
restore_command = '$copy_command'
standby_mode = on
) ) ;
@ -667,12 +667,14 @@ sub enable_archiving
# first. Paths also need to be double-quoted to prevent failures where
# the path contains spaces.
$ path =~ s{\\} {\\\\}g if ( $ TestLib:: windows_os ) ;
my $ copy_command = $ TestLib:: windows_os ?
qq{ copy "%p" "$path \\ \\ %f" } :
qq{ cp %p $path/%f } ;
my $ copy_command =
$ TestLib:: windows_os
? qq{ copy "%p" "$path \\ \\ %f" }
: qq{ cp %p $path/%f } ;
# Enable archive_mode and archive_command on node
$ self - > append_conf ( 'postgresql.conf' , qq(
$ self - > append_conf (
'postgresql.conf' , qq(
archive_mode = on
archive_command = '$copy_command'
) ) ;