Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 17194476FED for ; Fri, 8 Nov 2002 10:55:36 -0500 (EST) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by postgresql.org (Postfix) with ESMTP id 30C1E47702B for ; Fri, 8 Nov 2002 10:55:34 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id gA8FtBa03406; Fri, 8 Nov 2002 10:55:11 -0500 (EST) From: Bruce Momjian Message-Id: <200211081555.gA8FtBa03406@candle.pha.pa.us> Subject: Re: PQcmdTuples() declaration In-Reply-To: <5860.1036768512@sss.pgh.pa.us> To: Tom Lane Date: Fri, 8 Nov 2002 10:55:11 -0500 (EST) Cc: Payman , Michael Klatt , pgsql-interfaces@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/25 X-Sequence-Number: 3273 Tom Lane wrote: > Bruce Momjian writes: > > 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? > > Adding a const to the result type will break client applications that > aren't expecting it. I don't think we can get away with that. > > We could still declare the input type as const if we were willing to > cast away const inside the functions, but that seems pretty ugly. Yep, seems pretty ugly to me too. Why bother calling it a const if we are going to cast it away. I have updated the docs for 7.3 and CVS to match the non-const code. Let's see if this issue comes up again. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073