Allow postgres user to create database
The context for this is testing in Django, where a test database needs to be created. A permission denied error can occur if the user (not OS user) that owns the database does not have permission to create databases (I created the database and user via psql). Firstly log in as the postgres user (i.e. with the username ‘postgres’) and then use psql to alter the database ower.
To give the postgres user permission:
Don’t forget the trailing semi-colon.