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