FATAL: role "postgres" does not exist

logo

createuser not working

According to the message, there’s no user named postgres in the DB. So, let’s try to create it with the createuser command installed together with postgres. Make sure the postgres user have admin permissions by providing the --superuser operator.

But after pressing enter, to my surprise, the same error shows again.

Fix it by using OS Username

$ createuser -s postgres -U <os-username>