Re: pqlib in c++: PQconnectStart PQconnectPoll

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "madhtr" <madhtr(at)schif(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pqlib in c++: PQconnectStart PQconnectPoll
Date: 2007-08-14 20:53:32
Message-ID: 11745.1187124812@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"madhtr" <madhtr(at)schif(dot)org> writes:
> ... here's the source ... can u tell me whats wrong?

Well, your usage of "pge" seems fairly broken, in particular the random
(and wrong) assumptions about which values are or are not zero. AFAICT
this code doesn't really distinguish between PGRES_POLLING_FAILED and
PGRES_POLLING_OK. And if it does return failure, there's no way for the
caller to know which enum type the failure code belongs to.

You didn't show us the code that is actually reporting the error, but I
wonder whether it isn't equally confused about how to determine what the
error is.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dmitry Koterov 2007-08-14 21:06:58 Re: Creating a row during a select
Previous Message Kristo Kaiv 2007-08-14 20:52:16 Re: PgAdmin .sql default handler