Showing posts with label FATAL: Peer authentication failed for user "postgres". Show all posts
Showing posts with label FATAL: Peer authentication failed for user "postgres". Show all posts

Tuesday, November 7, 2017

FATAL: Peer authentication failed for user "postgres"

psql dump database from other user without loginto postgres user

$ whoami
ubuntu

$ pg_dump -U postgres dbname > db.sql
FATAL:  Peer authentication failed for user "postgres"


Solution :

sudo nano /etc/postgresql/9.4/main/pg_hba.conf

Change

local   all             postgres                                peer
to
local   all             postgres                                trust


Restart postgresql.