Re: [HACKERS] libpq++ doc error?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vince Vielhaber <vev(at)michvhf(dot)com>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] libpq++ doc error?
Date: 1999-10-06 14:10:17
Message-ID: 13509.939219017@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Vince Vielhaber <vev(at)michvhf(dot)com> writes:
> I just sent patches for libpq++ to return an int (I'll also submit changes
> to the sgml docs) and return a -1 if PQcmdTuples() returns a NULL pointer.
> I just haven't been able to convince it to return a NULL.

It won't. If you look at the source, it's quite clear that it never
returns NULL. It will return an empty string ("") if it notices a
problem.

Also, if you wanted to be really paranoid you'd check that what it
returns actually looks like it is a number, because PQcmdTuples doesn't
check that there is a number in the right spot in the command status
returned by the backend.

These two points together are why I suggested testing for an initial
digit...

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vince Vielhaber 1999-10-06 14:15:12 Re: [HACKERS] Re: [GENERAL] Re: [PHP3] Re: PostgreSQL vs Mysql comparison
Previous Message Thomas Lockhart 1999-10-06 14:07:41 psql and comments