Re: [pgsql-novice] Daily digest v1.3706 (6 messages)

From: Michael Convey <smconvey(at)gmail(dot)com>
To: Alan Hodgson <ahodgson(at)simkin(dot)ca>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: [pgsql-novice] Daily digest v1.3706 (6 messages)
Date: 2015-11-17 15:49:15
Message-ID: CACbnAKZn_1z9+0WX5xpmnQ5QtL0zD536vaTtq7t6pc69ngnHHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Mon, Nov 16, 2015 at 6:26 PM, Alan Hodgson <ahodgson(at)simkin(dot)ca> wrote:

> On Monday, November 16, 2015 05:36:08 PM Michael Convey wrote:
> > ​Thank you. Assuming a default Fedora installation, if I am logged in as
> > Linux user lab and I don't know the Linux "postgres"​ password, but I do
> > know the PostgreSQL "postgres" role password; what is the syntax (from
> the
> > Linux command line) to login as the "postgres" role and connect to the
> > "postgres" database?
>
> psql -U postgres postgres
>
> It'll prompt for the password.
>
> Make sure you've enabled md5 or password as an authentication method
> allowed
> for local in pg_hba.conf.

​Thank you. I received the following error:

bash-4.2 ~ $ psql -U postgres postgres
psql: FATAL: Peer authentication failed for user "postgres"

Here's the relevant portion of my ​pg_hba.conf file:

-----------------------------------------------------------------------------------------------------------
# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 ident
# IPv6 local connections:
host all all ::1/128 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 ident
#host replication postgres ::1/128 ident
-----------------------------------------------------------------------------------------------------------

Do I modify the first section, as follows?

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all peer
local all all samehost md5 #added

Or, do I replace the first line with #added?

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Felipe Santos 2015-11-17 15:57:19 Re: [pgsql-novice] Daily digest v1.3706 (6 messages)
Previous Message petrov.boris.v@mail.ru 2015-11-17 13:29:52 Re: Different performance of two simple queries