<term><option>--auth=<replaceable class="parameter">authmethod</replaceable></option></term>
<listitem>
<para>
- This option specifies the authentication method for local users used
- in <filename>pg_hba.conf</> (<literal>host</literal>
- and <literal>local</literal> lines). Do not use <literal>trust</>
- unless you trust all local users on your system. <literal>trust</> is
- the default for ease of installation.
+ This option specifies the default authentication method for local
+ users used in <filename>pg_hba.conf</> (<literal>host</literal>
+ and <literal>local</literal> lines). <command>initdb</command> will
+ prepopulate <filename>pg_hba.conf</filename> entries using the
+ specified authentication method for non-replication as well as
+ replication connections.
+ </para>
+
+ <para>
+ Do not use <literal>trust</> unless you trust all local users on your
+ system. <literal>trust</> is the default for ease of installation.
</para>
</listitem>
</varlistentry>
host all all ::1/128 @authmethodhost@
# Allow replication connections from localhost, by a user with the
# replication privilege.
-@remove-line-for-nolocal@#local replication @default_username@ @authmethodlocal@
-#host replication @default_username@ 127.0.0.1/32 @authmethodhost@
-#host replication @default_username@ ::1/128 @authmethodhost@
+@remove-line-for-nolocal@local replication all @authmethodlocal@
+host replication all 127.0.0.1/32 @authmethodhost@
+host replication all ::1/128 @authmethodhost@
"@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);
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');
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.
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";
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.
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};
}
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};
}
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.
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
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};
}