Re: BUG #2364: DB Error: connect failed ... PHP/PostgreSql - Mailing list pgsql-bugs

From Richard Huxton
Subject Re: BUG #2364: DB Error: connect failed ... PHP/PostgreSql
Date
Msg-id 44312028.100@archonet.com
Whole thread Raw
In response to BUG #2364: DB Error: connect failed ... PHP/PostgreSql  ("manashi" <manashi_130582@rediffmail.com>)
List pgsql-bugs
manashi wrote:
> The following bug has been logged online:
>
> Bug reference:      2364
> Logged by:          manashi
> Email address:      manashi_130582@rediffmail.com
> PostgreSQL version: psql (PostgreSQ
> Operating system:   Linux
> Description:        DB Error: connect failed ... PHP/PostgreSql

This is probably *not* a bug in PostgreSQL, and you'll be able to find
better help at the pgsql-general/pgsql-novice/pgsql-php mailing lists.

However...

> $dsn = "pgsql://$username:$password@$hostname/$dbname";
> echo "The DSN : $dsn<br>";
>
> $con = DB::connect($dsn);

> The DSN : pgsql://root:@localhost/sample
> The Connection Object : Object id #2
> Error Number : 1
> The Message : DB Error: connect failed

> i hav tried a lot to find out the error but unable to find it

Well:
1. Are you logging connection attempts on the server-side and what does
it show?
2. Have you tried turning error verbosity up?
3. What does "psql -U root -h localhost sample" do for you?
4. Have you checked your pg_hba.conf file

It's almost certainly an issue with #4 - the pg_hba.conf file.

--
   Richard Huxton
   Archonet Ltd

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #2370: 25P02,current transaction is aborted, commands ignored until end of transaction block
Next
From: Richard Huxton
Date:
Subject: Re: BUG #2365: can't install