pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Payman <payman@Club-Internet.fr>
Cc: Michael Klatt <mdklatt@ou.edu>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: PQcmdTuples() declaration
Date: Fri, 8 Nov 2002 10:55:11 -0500 (EST)
Message-ID: <200211081555.gA8FtBa03406@candle.pha.pa.us> (raw)
In-Reply-To: <5860.1036768512@sss.pgh.pa.us>

Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> 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



view thread (7+ messages)

Message-ID: <200211081555.gA8FtBa03406@candle.pha.pa.us>
Permalink:  ../200211081555.gA8FtBa03406@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200211081555.gA8FtBa03406@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: pgman@candle.pha.pa.us, tgl@sss.pgh.pa.us, payman@Club-Internet.fr, mdklatt@ou.edu
  Subject: Re: PQcmdTuples() declaration
  In-Reply-To: <200211081555.gA8FtBa03406@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox