Let migration create pg database
fra
HOBBYTop 10% ContributorOP

7 months ago

Hello, if I understood correctly when I create a pg instance it already create a db, is there a way to skip the db creation?
my migration script take care of db creation + creation of a couple of roles/users, some action need to be run with superadmin while all the rest of migration have a bespoke user.

thanks

4 Replies

fra
HOBBYTop 10% ContributorOP

7 months ago

N/A


brody
EMPLOYEE

7 months ago

Hello,

The Postgres software itself is creating the initial database and user by default, but of course there is no obligation to use them long term, so feel free to create your own database and users.


fra
HOBBYTop 10% ContributorOP

7 months ago

actually I just tried to just change the dbname env and all did work fine, I should have tried before writing, many thanks to confirm


brody
EMPLOYEE

7 months ago

The database name environment variable (along with the username and password variables) is read-only. Changing them would not have any effect on the database name, username, or password.


Loading...