Re: Request assistance connecting with Pg::connectdb

From: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>
To: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
Cc: "Wright, Ryan P" <Ryan(dot)Wright(at)pnl(dot)gov>, "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Request assistance connecting with Pg::connectdb
Date: 2002-11-21 23:59:30
Message-ID: 3DDD7362.8050002@intransa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Actually in Perl the equality operator 'eq' means that the operands
engade in this
operation are of type string.

Since C programmer use symbolic constants for improved readability, then
your suggestiion....

Nigel J. Andrews wrote:

>On Thu, 21 Nov 2002, Medi Montaseri wrote:
>
>
>
>>While I don't have a solution for you, I'd recommend using DBI.
>>
>>Wright, Ryan P wrote:
>>
>>
>>
>>>Hello,
>>>
>>>I am having a heck of a time connecting to my postgres server, and was
>>>hoping some kind soul would advise me on how to proceed.
>>>
>>>The problem: Perl script dies with no error message.
>>>
>>>Code snippet:
>>>
>>>$conn = Pg::connectdb("dbname=testdb host=localhost port=5432 user=postgres
>>>password=test");
>>>print "status = ",$conn->status, "\n";
>>>die $conn->errorMessage unless PGRES_CONNECTION_OK eq $conn->status;
>>>
>>>
>
>i think you want that test to read:
>
>$conn->status == PGRES_CONNECTION_OK
>
>You're getting the string equality test mixed up with another languages numeric
>one. Or do I mean that the other way around
>
>
>--
>Nigel Andrews
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>message can get through to the mailing list cleanly
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Medi Montaseri 2002-11-22 00:11:04 Re: Request assistance connecting with Pg::connectdb
Previous Message Wright, Ryan P 2002-11-21 23:34:40 Re: Request assistance connecting with Pg::connectdb