PostgreSQL's error messages are terse, and a few of them mislead newcomers. "Role does not exist" when you never created a role, or "relation does not exist" when you can see the table right there. Here's what each common one really means.
FATAL: role "me" does not exist
Without -U , psql logs in as your operating-system username . Fresh installs only have a postgres role.
sudo -u postgres createuser --interactive # create a role named after you psql -U postgres -h localhost # or connect as postgres explicitly
Enter fullscreen mode
Exit fullscreen mode
On macOS with Homebrew it's the reverse: the superuser is your username, and role "postgres" does not exist is the common error.
FATAL: password authentication failed for user "app"
Either the password is wrong, or pg_hba.conf demands a password for a role that never had one.…