Re: How To Install Extension Via Script File? - Mailing list pgsql-general

From Tom Lane
Subject Re: How To Install Extension Via Script File?
Date
Msg-id 9293.1376008924@sss.pgh.pa.us
Whole thread Raw
In response to Re: How To Install Extension Via Script File?  (Don Parris <parrisdc@gmail.com>)
Responses Re: How To Install Extension Via Script File?  (Don Parris <parrisdc@gmail.com>)
List pgsql-general
Don Parris <parrisdc@gmail.com> writes:
> When I try a simple psql -U postgres -W - just to initiate the psql
> session, I get:
> psql: FATAL:  Peer authentication failed for user "postgres"

> It's like my regular user cannot connect as the postgres user.

You're right, it can't, if you've selected peer authentication in
pg_hba.conf.  You'd need to use some other auth method, perhaps
password-based auth, if you want this to work.  Read up on auth methods
in the fine manual.

> However, this works (with me just typing my password for sudo):
> donp@wiesbaden:~$ sudo -u postgres psql -U postgres
> [sudo] password for donp:

Sure, because then psql is launched as the postgres OS user, and peer auth
will let that user connect as the postgres DB user.

            regards, tom lane


pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Weird error when setting up streaming replication
Next
From: Sergey Konoplev
Date:
Subject: Re: Performance of ORDER BY RANDOM to select random rows?