Re: Ident authentication failed for user - Mailing list pgsql-general

From John R Pierce
Subject Re: Ident authentication failed for user
Date
Msg-id 4F4FB126.3050903@hogranch.com
Whole thread Raw
In response to Ident authentication failed for user  (Ruben Blanco <rubenblan@gmail.com>)
Responses Re: Ident authentication failed for user
List pgsql-general
On 03/01/12 9:02 AM, Ruben Blanco wrote:
> I cannot connect to my Postgres database from my PHP scripts. I get the error:
>
>     PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server:
> FATAL:  Ident authentication failed for user "postgres" in ...
>
>
> I have tried many combinations for "host" TYPE in "pg_hba.conf"
> (restarting postmaster) without success:
>
> # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
>
> # "local" is for Unix domain socket connections only
> local   all         all                               ident
>
> ...
> #host    all         all         *                    trust
> host    all         all         127.0.0.1         255.255.255.255   trust
> #host    all         all         localhost            trust
> host     all        all         ::1/128               trust
>
>
> Isn't the las record the less restrictive configuration for "host" connections?

specify host=localhost, otherwise its using the first 'local' line,
which specifies 'ident' authentication, as the error implies.

you do realize, trust lets any process on the localhost authenticate as
any user, including the postgres DBA account?


--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast


pgsql-general by date:

Previous
From: Adam Bruss
Date:
Subject: Re: accumulating handles problem on machine running postgresql
Next
From: Chris McCormick
Date:
Subject: Re: Problem with initdb and two versions on one server?