Content-Length: 264741 | pFad | http://github.com/postgrespro/postgres_cluster/commit/7df974ee0bfd8978830b941e7af5697fd4268656

2F Disallow superuser names starting with 'pg_' in initdb · postgrespro/postgres_cluster@7df974e · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/7df974ee0bfd8978830b941e7af5697fd4268656

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy