Re: pg_connect sometimes works sometimes not

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: "pobox(at)verysmall(dot)org" <pobox(at)verysmall(dot)org>
Cc: Richard Huxton <dev(at)archonet(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_connect sometimes works sometimes not
Date: 2007-04-25 15:03:53
Message-ID: 20070425150353.GA15706@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 25, 2007 at 04:50:46PM +0200, pobox(at)verysmall(dot)org wrote:
> Richard Huxton wrote:
> >pobox(at)verysmall(dot)org wrote:
> >>What other variable (which are sometimes there, sometimes not) reasons
> >>there can be pg_connect to fail?
> >
> >What result-code/error do you get? What do your logs show?
>
> I have -
>
> $connection = pg_connect("$host $db $user $pass");
>
> When I get the error it is because $connection is 'false'.
>
> Thought of using pg_result_error - but it seems applicable only to
> queries (i.e. with pg_query or pg_execute). How can I get an error code?

In the C interface it's called PQerrorMessage(). I'm sure PHP has an
equivalent.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message sangeetha k.s 2007-04-25 15:13:22 reg: bitmap index implementation
Previous Message Raymond O'Donnell 2007-04-25 14:59:25 Re: pg_connect sometimes works sometimes not