Role Does Not Exist Error in PostgreSQL

Understanding PostgreSQL Roles

Roles are used for authentication and permissions in PostgreSQL.

Check Existing Roles

\du

Create Missing Role

CREATE ROLE username WITH LOGIN PASSWORD 'password';

Assign Permissions

GRANT ALL PRIVILEGES ON DATABASE mydb TO username;