Re: PQcmdTuples() declaration

From: Payman <payman(at)Club-Internet(dot)fr>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Michael Klatt <mdklatt(at)ou(dot)edu>, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: PQcmdTuples() declaration
Date: 2002-11-08 09:25:04
Message-ID: 3DCB82F0.4070607@Club-Internet.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hi Bruce,

The code compile ok, PGresult *res is not changed
in source code of PQcmdTuples, for me it's a const PGresult *res.
Now the probleme is : who put it in non const and why ?
Is changing this will cause problems in actual project for anyone?

Other thing is, PQcmdTuples return numbre of tuples after a insert,
delete, update
I say Number, Number is a numerical value and not String value ...

in libpq++ :
int PgDatabase::CmdTuples() const
{
const char *a = PQcmdTuples(pgResult);
return a[0] ? atoi(a) : -1;
}

return int value and not char *
(changing this cause more problems for other users...)

thanks
Payman

Bruce Momjian wrote:

>I am not sure how to deal with this. I have updated the 7.3/CVS docs to
>match the include file and code, which has no consts.
>
>The issue with PQcmdTuples() and PQcmdStatus() are that they return
>*result structure member pointers. The patch makes the *result a const,
>then we have to return the values as const's. The code compiled OK, so
>I assume that is fine. How does that sound to others, or should we keep
>the result non-const?
>
>
>

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2002-11-08 15:15:12 Re: PQcmdTuples() declaration
Previous Message Jan Klostermann 2002-11-08 08:15:00 Wish to build a LabVIEW-Interface (= graphical programming language)