Skip to content

Commit 6f69b96

Browse files
committed
Wording quibbles regarding initdb username
Use disallowed instead of reserved, cannot instead of can not, and double quotes instead of single quotes. Also add a test to cover the bug which started this discussion. Per discussion with Tom.
1 parent 7df974e commit 6f69b96

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/bin/initdb/initdb.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3564,7 +3564,7 @@ main(int argc, char *argv[])
35643564

35653565
if (strncmp(username, "pg_", 3) == 0)
35663566
{
3567-
fprintf(stderr, _("%s: superuser name \"%s\" is reserved; role names can not begin with 'pg_'\n"), progname, username);
3567+
fprintf(stderr, _("%s: superuser name \"%s\" is disallowed; role names cannot begin with \"pg_\"\n"), progname, username);
35683568
exit(1);
35693569
}
35703570

src/bin/initdb/t/001_initdb.pl

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use warnings;
77
use PostgresNode;
88
use TestLib;
9-
use Test::More tests => 14;
9+
use Test::More tests => 15;
1010

1111
my $tempdir = TestLib::tempdir;
1212
my $xlogdir = "$tempdir/pgxlog";
@@ -29,6 +29,10 @@
2929
[ 'initdb', '-X', 'pgxlog', $datadir ],
3030
'relative xlog directory not allowed');
3131

32+
command_fails(
33+
[ 'initdb', '-U', 'pg_test', $datadir ],
34+
'role names cannot being with "pg_"');
35+
3236
mkdir $datadir;
3337
command_ok([ 'initdb', '-N', '-T', 'german', '-X', $xlogdir, $datadir ],
3438
'successful creation');

0 commit comments

Comments
 (0)