Re: pg_connect troubles on localhost - Mailing list pgsql-general

From Jerry Sievers
Subject Re: pg_connect troubles on localhost
Date
Msg-id m3iruhtpra.fsf@prod01.jerrysievers.com
Whole thread Raw
In response to pg_connect troubles on localhost  (John Taber <jtaber@johntaber.net>)
Responses Re: pg_connect troubles on localhost  (John Taber <jtaber@johntaber.net>)
List pgsql-general
John Taber <jtaber@johntaber.net> writes:

> using postgresql 8.1 on Ubuntu Breezy
> I cannot connect to a database I created - checking \du the username is
> listed.  I also created a password with #ALTER ROLE yyyy WITH PASSWORD
> 'zzzz'  I tried without password but it calls for a password.  Any ideas?
>
> <?php
> $vhost = 'localhost';
> $vname = 'xxxx';
> $vuser = 'yyyy';
> $vpassword = 'zzzz';
> $db_handle = pg_connect("dbname=$vname user=$vuser password=$vpassword");
> pg_close($db_handle);
> ?>
>
> Warning: pg_connect() [function.pg-connect]: Unable to connect to
> PostgreSQL server:
> FATAL: Ident authentication failed for user "yyyy" in /var/www/test.php
> on line 12

See to it that there's  an entry in pg_ident.conf to map the webserver
process owner to  your vuser DB username.

The error message is telling you that your pg_hba.conf file has an
entry for the database that uses the ident map file.

See comments in both files and the Postgres docs as well for more
info.

HTH


--
-------------------------------------------------------------------------------
Jerry Sievers   305 854-3001 (home)     WWW ECommerce Consultant
                305 321-1144 (mobile    http://www.JerrySievers.com/

pgsql-general by date:

Previous
From: John Taber
Date:
Subject: pg_connect troubles on localhost
Next
From: "Walter Dnes"
Date:
Subject: New user questions