diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2017-03-09 08:27:16 -0500 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2017-03-09 08:39:44 -0500 |
commit | be37c2120a2a88e5ba852d42952c77b6bf5d5271 (patch) | |
tree | c6862bda00c4392427b3a9c96836cac7fb21a3e3 /src/test/perl/PostgresNode.pm | |
parent | 355d3993c53ed62c5b53d020648e4fbcfbf5f155 (diff) |
Enable replication connections by default in pg_hba.conf
initdb now initializes a pg_hba.conf that allows replication connections
from the local host, same as it does for regular connections. The
connecting user still needs to have the REPLICATION attribute or be a
superuser.
The intent is to allow pg_basebackup from the local host to succeed
without requiring additional configuration.
Michael Paquier <michael.paquier@gmail.com> and me
Diffstat (limited to 'src/test/perl/PostgresNode.pm')
-rw-r--r-- | src/test/perl/PostgresNode.pm | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm index e5cb348f4c8..7e530676b29 100644 --- a/src/test/perl/PostgresNode.pm +++ b/src/test/perl/PostgresNode.pm @@ -349,11 +349,7 @@ sub set_replication_conf open my $hba, ">>$pgdata/pg_hba.conf"; print $hba "\n# Allow replication (set up by PostgresNode.pm)\n"; - if (!$TestLib::windows_os) - { - print $hba "local replication all trust\n"; - } - else + if ($TestLib::windows_os) { print $hba "host replication all $test_localhost/32 sspi include_realm=1 map=regress\n"; @@ -373,9 +369,6 @@ a directory that's only accessible to the current user to ensure that. On Windows, we use SSPI authentication to ensure the same (by pg_regress --config-auth). -pg_hba.conf is configured to allow replication connections. Pass the keyword -parameter hba_permit_replication => 0 to disable this. - WAL archiving can be enabled on this node by passing the keyword parameter has_archiving => 1. This is disabled by default. @@ -396,8 +389,6 @@ sub init my $pgdata = $self->data_dir; my $host = $self->host; - $params{hba_permit_replication} = 1 - unless defined $params{hba_permit_replication}; $params{allows_streaming} = 0 unless defined $params{allows_streaming}; $params{has_archiving} = 0 unless defined $params{has_archiving}; @@ -451,7 +442,7 @@ sub init } close $conf; - $self->set_replication_conf if $params{hba_permit_replication}; + $self->set_replication_conf if $params{allows_streaming}; $self->enable_archiving if $params{has_archiving}; } @@ -591,9 +582,6 @@ Does not start the node after initializing it. A recovery.conf is not created. -pg_hba.conf is configured to allow replication connections. Pass the keyword -parameter hba_permit_replication => 0 to disable this. - Streaming replication can be enabled on this node by passing the keyword parameter has_streaming => 1. This is disabled by default. @@ -615,8 +603,6 @@ sub init_from_backup my $root_name = $root_node->name; $params{has_streaming} = 0 unless defined $params{has_streaming}; - $params{hba_permit_replication} = 1 - unless defined $params{hba_permit_replication}; $params{has_restoring} = 0 unless defined $params{has_restoring}; print @@ -638,7 +624,6 @@ sub init_from_backup qq( port = $port )); - $self->set_replication_conf if $params{hba_permit_replication}; $self->enable_streaming($root_node) if $params{has_streaming}; $self->enable_restoring($root_node) if $params{has_restoring}; } |