Skip to content

Commit 7df974e

Browse files
committed
Disallow superuser names starting with 'pg_' in initdb
As with CREATE ROLE, disallow users from specifying initial superuser names which begin with 'pg_' in initdb. Per discussion with Tom.
1 parent 9eb7a0a commit 7df974e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bin/initdb/initdb.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3562,6 +3562,12 @@ main(int argc, char *argv[])
35623562
if (strlen(username) == 0)
35633563
username = effective_user;
35643564

3565+
if (strncmp(username, "pg_", 3) == 0)
3566+
{
3567+
fprintf(stderr, _("%s: superuser name \"%s\" is reserved; role names can not begin with 'pg_'\n"), progname, username);
3568+
exit(1);
3569+
}
3570+
35653571
printf(_("The files belonging to this database system will be owned "
35663572
"by user \"%s\".\n"
35673573
"This user must also own the server process.\n\n"),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy