Direct access to to gitlab database

gitlab

I am running the AWS AMI from gitlab. I am trying to access the postgres database directly using psql. I thought I could just use the credentials in database.yml, since the rails application is working fine:

/opt/gitlab/embedded/bin/psql -U gitlab -d gitlabhq_production

But I get:

psql: FATAL:  Peer authentication failed for user "gitlab"

How can the rails app be connecting to the database while psql cannot?

Best Solution

sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql/ gitlabhq_production
Related Question