Re: BUG #18880: Can't have a database without having postgres as a db_name and username

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: kevenboudreau58(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18880: Can't have a database without having postgres as a db_name and username
Date: 2025-04-07 13:48:14
Message-ID: 3392058.1744033694@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> Like I said I can't have a database with another db_name and
> username

Sure you can. The bootstrap superuser account's name is set by
initdb [1]. It's true that you can't change the initial set of
database names (postgres, template0, template1), but you can
create more databases within the installation [2].

If you're really stubborn you can delete or rename the postgres
database, but you might regret it. A lot of client tools assume
that as the default database-to-connect-to. I don't recommend
deleting or renaming template0 or template1 under any
circumstances [3].

regards, tom lane

[1] https://www.postgresql.org/docs/current/app-initdb.html
[2] https://www.postgresql.org/docs/current/manage-ag-createdb.html
[3] https://www.postgresql.org/docs/current/manage-ag-templatedbs.html

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Ing. Marijo Kristo 2025-04-07 14:27:41 Aw:  Re: Re: Revoke Connect Privilege from Database not working
Previous Message David G. Johnston 2025-04-07 13:42:28 Re: Re: Revoke Connect Privilege from Database not working