I\'m logged in with a superuser account and this is the process I\'m doing:
1-> CREATE ROLE test WITH IN ROLE testroles PASSWORD \'testpasswd\' 2-> CREATE S
I fixed it by logging in with postgres user (and then apply my changes, which was changing ownership in my case):
postgres
sudo -u postgres psql ALTER DATABASE my_database OWNER TO new_user;