Re: Sorry, real newbie question about connecting to a database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: stan <stanb(at)panix(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Sorry, real newbie question about connecting to a database
Date: 2019-08-19 14:55:04
Message-ID: 22803.1566226504@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

stan <stanb(at)panix(dot)com> writes:
> But I cannot conect, or swith to user
> employee:

> stan(at)smokey:/etc/postgresql/11/main$ psql -U employee
> psql: FATAL: Peer authentication failed for user "employee"

This means that you've set pg_hba.conf to specify "peer" authentication,
which by default only lets you connect as a PG role named the
same as your OS account. (This is about are-you-who-you-say-you-are;
whether who-you-say-you-are has privilege to connect is independent.)

You could use some other auth method, or you could set up a mapping
file that says you (stan) are allowed to connect as "employee".

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-08-19 16:43:29 Re: Sorry, real newbie question about connecting to a database
Previous Message stan 2019-08-19 14:44:45 Sorry, real newbie question about connecting to a database