=> CREATE ROLE creator WITH CREATEDB CREATEROLE;
CREATE ROLE
=> CREATE ROLE weak WITH LOGIN;
CREATE ROLE
=> \c - weak
You are now connected to database "postgres" as user "weak".
=> CREATE DATABASE access_roles;
ERROR: permission denied to create database
=> \c - postgres
You are now connected to database "postgres" as user "postgres".
=> GRANT creator TO weak;
GRANT ROLE
=> \c - weak
You are now connected to database "postgres" as user "weak".
=> SET ROLE creator;
SET
=> CREATE DATABASE access_roles;
CREATE DATABASE