Re: pg_connect sometimes works sometimes not

From: "pobox(at)verysmall(dot)org" <pobox(at)verysmall(dot)org>
To: 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 14:50:46
Message-ID: 462F6AC6.9080802@verysmall.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

PostgreSQL is instructed to log into the syslog, which is
/var/log/messages. There are only two type of things there from today -

[1-1] WARNING: nonstandard use of \\ in a string literal at character XXX

[1-2] HINT: Use the escape string syntax for backslashes, e.g., E'\\'.

But it does not seem like any of these are related to pg_connect, or am
I wrong (I guess they are related to bad code somewhere).

Thank you,
Iv

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2007-04-25 14:51:50 Re: WAL files, warm spares and minor versions
Previous Message Andrei Kovalevski 2007-04-25 14:49:31 Re: query from a list of ids