Rails and PostgreSQL: Role postgres does not exist

Actually, for some unknown reason, I found the issue was actually because the postgresql role hadn’t been created.

Try running:

createuser -s -r postgres

Note that roles are the way that PostgreSQL maintains database permissions. If there is no role for the postgres user, then it can’t access anything. The createuser command is a thin wrapper around the commands CREATE USER, CREATE ROLE, etc.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)