From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alberto Cabello Sanchez <alberto@unex.es>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: ColumnName and ColumnNumber in libpq (C interface)
Date: Tue, 16 Sep 2003 09:46:26 -0400
Message-ID: <16696.1063719986@sss.pgh.pa.us> (raw)
In-Reply-To: <20030916075640.GA10965@guadiana.unex.es>
References: <3F65715A.BDCAD1FB@rodos.fzk.de>
<10317.1063637327@sss.pgh.pa.us>
<20030916075640.GA10965@guadiana.unex.es>
Alberto Cabello Sanchez <alberto@unex.es> writes:
> On Mon, Sep 15, 2003 at 10:48:47AM -0400, Tom Lane wrote:
>> I wonder whether this behavior is appropriate for PQfnumber, though.
>> It's never been documented ... and certainly should be if we decide
>> we should keep it. Comments?
> I think PQfnumber(res,PQfname(res,0))==-1 should_never_happen (c) with a
> valid PGresult * res.
> Maybe PQfname(res,0) should be "\"Bar\"", not "Bar".
I don't really want to change PQfname; that would probably break more
apps than changing PQfnumber.
We could achieve the property you suggest if we forgot about
case-insensitive matching and dequoting, and simply made PQfnumber check
for an exact match.
Or we could try some combination behavior (say, try exact match, then
if no luck apply the dequote/downcase logic). This might offer better
backwards compatibility, but the more complex the behavior, the more
potential for surprising corner cases ...
regards, tom lane
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: tgl@sss.pgh.pa.us, alberto@unex.es
Subject: Re: ColumnName and ColumnNumber in libpq (C interface)
In-Reply-To: <16696.1063719986@sss.pgh.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