Re: pqlib in c++: PQconnectStart PQconnectPoll - Mailing list pgsql-general

From Tom Lane
Subject Re: pqlib in c++: PQconnectStart PQconnectPoll
Date
Msg-id 11745.1187124812@sss.pgh.pa.us
Whole thread Raw
In response to Re: pqlib in c++: PQconnectStart PQconnectPoll  ("madhtr" <madhtr@schif.org>)
List pgsql-general
"madhtr" <madhtr@schif.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

pgsql-general by date:

Previous
From: Kristo Kaiv
Date:
Subject: Re: PgAdmin .sql default handler
Next
From: Ron Johnson
Date:
Subject: Re: MVCC cons