diff options
| author | Peter Eisentraut | 2017-03-09 13:27:16 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2017-03-09 13:39:44 +0000 |
| commit | be37c2120a2a88e5ba852d42952c77b6bf5d5271 (patch) | |
| tree | c6862bda00c4392427b3a9c96836cac7fb21a3e3 /src/bin | |
| 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/bin')
| -rw-r--r-- | src/bin/initdb/initdb.c | 5 | ||||
| -rw-r--r-- | src/bin/pg_basebackup/t/010_pg_basebackup.pl | 7 |
2 files changed, 2 insertions, 10 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 4968fc783e..da40d7ab67 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -1235,11 +1235,6 @@ setup_config(void) "@authcomment@", (strcmp(authmethodlocal, "trust") == 0 || strcmp(authmethodhost, "trust") == 0) ? AUTHTRUST_WARNING : ""); - /* Replace username for replication */ - conflines = replace_token(conflines, - "@default_username@", - username); - snprintf(path, sizeof(path), "%s/pg_hba.conf", pg_data); writefile(path, conflines); diff --git a/src/bin/pg_basebackup/t/010_pg_basebackup.pl b/src/bin/pg_basebackup/t/010_pg_basebackup.pl index aafb138fd5..14bd813896 100644 --- a/src/bin/pg_basebackup/t/010_pg_basebackup.pl +++ b/src/bin/pg_basebackup/t/010_pg_basebackup.pl @@ -4,7 +4,7 @@ use Cwd; use Config; use PostgresNode; use TestLib; -use Test::More tests => 73; +use Test::More tests => 72; program_help_ok('pg_basebackup'); program_version_ok('pg_basebackup'); @@ -15,15 +15,12 @@ my $tempdir = TestLib::tempdir; my $node = get_new_node('main'); # Initialize node without replication settings -$node->init(hba_permit_replication => 0); +$node->init; $node->start; my $pgdata = $node->data_dir; $node->command_fails(['pg_basebackup'], 'pg_basebackup needs target directory specified'); -$node->command_fails( - [ 'pg_basebackup', '-D', "$tempdir/backup" ], - 'pg_basebackup fails because of hba'); # Some Windows ANSI code pages may reject this filename, in which case we # quietly proceed without this bit of test coverage. |
