- Install postgresql and check installation with
psql --version
(keep your password in mind) - Log in as
postgres
user withpsql -U postgres
and create a database withCREATE DATABASE <db-name>;
- Create a new role with limited permissions for spring boot with
CREATE ROLE <role-name> WITH PASSWORD '<password>';
- Give new role right to log in with
ALTER ROLE <role-name> WITH LOGIN;
- Grant privileges to new role with
GRANT CREATE, DROP ON DATABASE <db-name> TO <role-name>;
Alternately you can run the setup.sql
script that is slightly more sophisticated with psql -U postgres -f .\setup.sql