pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: stan <stanb@panix.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Sorry, real newbie question about connecting to a database
Date: Mon, 19 Aug 2019 10:55:04 -0400
Message-ID: <22803.1566226504@sss.pgh.pa.us> (raw)
In-Reply-To: <20190819144445.GA7984@panix.com>
References: <20190819144445.GA7984@panix.com>

stan <stanb@panix.com> writes:
> But I cannot conect, or swith to user
> employee:

> stan@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





view thread (3+ messages)  latest in thread

Message-ID: <22803.1566226504@sss.pgh.pa.us>
Permalink:  ../22803.1566226504@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22803.1566226504@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, stanb@panix.com
  Subject: Re: Sorry, real newbie question about connecting to a database
  In-Reply-To: <22803.1566226504@sss.pgh.pa.us>
  References: <20190819144445.GA7984@panix.com> <22803.1566226504@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox