Re: pg_hba.conf file - Mailing list pgsql-novice

From Oliver Elphick
Subject Re: pg_hba.conf file
Date
Msg-id 1039071082.7970.1037.camel@linda.lfix.co.uk
Whole thread Raw
In response to pg_hba.conf file  (hodges@xprt.net)
List pgsql-novice
On Thu, 2002-12-05 at 03:29, hodges@xprt.net wrote:
> I am getting this error trying to connect with
>
>
> Warning: pg_connect() unable to connect to PostgreSQL server: FATAL 1: No
> pg_hba.conf entry for host
> 127.0.0.1, user apache, database tom in /var/www/html/testphp.php on line 3
> connection failed!

You need a line like this (for 7.2.3 and earlier):

host  all  127.0.0.1   255.255.255.255  ident sameuser

for 7.3:

host  all  all  127.0.0.1   255.255.255.255  ident sameuser


(assuming you have a database user called 'apache' and are running an
ident server on that machine; if not, you need a different
authentication method instead of 'ident sameuser'.)

You need to make sure that this comes before any other host line that
would reject the connection.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Go ye therefore, and teach all nations, baptizing them
      in the name of the Father, and of the Son, and of the
      Holy Ghost; Teaching them to observe all things
      whatsoever I have commanded you; and, lo, I am with
      you alway, even unto the end of the world. Amen."
            Matthew 28:19,20


pgsql-novice by date:

Previous
From: Dmitri Touretsky
Date:
Subject: Re: Yet one more stupid question
Next
From: douggorley@shaw.ca
Date:
Subject: Problem starting the postmaster