By default configuration of PostgreSQL user called postgres and it comes with full super-admin access to entire PostgreSQL instance running on your operating system or in the Container. The below commands are helpful to create a database, username, password and grant permission for the user to access the specific database.
As we discussed above the postgres user has super-admin permission so switch user to postgres,
Enter into the postgres database
Then, execute the following commands, create a new database,
Create a user account with encrypted password,
Set grant privilege for the user to access the database,
If you would like to change the password run the command below,