Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id BFCF0475F54 for ; Fri, 8 Nov 2002 04:25:28 -0500 (EST) Received: from relay-1v.club-internet.fr (relay-1v.club-internet.fr [194.158.96.112]) by postgresql.org (Postfix) with ESMTP id 00582475EBB for ; Fri, 8 Nov 2002 04:25:28 -0500 (EST) Received: from Club-Internet.fr (lns01v-6-139.w.club-internet.fr [213.44.245.139]) by relay-1v.club-internet.fr (Postfix) with ESMTP id 301A8168D; Fri, 8 Nov 2002 10:25:05 +0100 (CET) Message-ID: <3DCB82F0.4070607@Club-Internet.fr> Date: Fri, 08 Nov 2002 10:25:04 +0100 From: Payman User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruce Momjian Cc: Michael Klatt , pgsql-interfaces@postgresql.org Subject: Re: PQcmdTuples() declaration References: <200211080511.gA85B2K11157@candle.pha.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/21 X-Sequence-Number: 3269 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? > > >