Menu

PostgreSQL errors in your first month, and what they actually mean
📰

PostgreSQL errors in your first month, and what they actually mean

DEV Community: postgres·Hollis·2 days ago
#jqUrKoCa
#devtopostgresql#devto#dev#error#role
Reading 0:00
15s threshold

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.