Re: How To Install Extension Via Script File?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Don Parris <parrisdc(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How To Install Extension Via Script File?
Date: 2013-08-09 00:42:04
Message-ID: 9293.1376008924@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Don Parris <parrisdc(at)gmail(dot)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(at)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sergey Konoplev 2013-08-09 00:43:31 Re: Performance of ORDER BY RANDOM to select random rows?
Previous Message Michael Paquier 2013-08-09 00:23:22 Re: Weird error when setting up streaming replication