0

I want to connect to my local installation of PostgreSQL 9.1 using my machine user (who is vagrant). So, after reading PostgreSQL documentation, I thought I just needed to:

  1. Add username map in pg_ident.conf:

    vp vagrant postgres

  2. Using the map in pg_hba.conf

    local all all peer map=vp

But I'm getting the error

sql: FATAL:  Peer authentication failed for user "vagrant"

If I try to connect to my server using psql.

I guess I'm misunderstanding the PostgreSQL manual. But, how could I get what I need? (locally connect with the user vagrant like if it was the postgres user)

Many thanks in advance

1 Answers1

1

Per comments, there was a prior pg_hba.conf line that also matched the criteria, and didn't have a map entry.

It was being matched first, so the one with the map wasn't reached.

Craig Ringer
  • 11,525