Skip site navigation (1) Skip section navigation (2)

Re: PQfnumber and duplicate column names....

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ralf Hasemann <rhasemann(at)mac(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: PQfnumber and duplicate column names....
Date: 2004-07-29 00:34:26
Message-ID: 1361.1091061266@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
Ralf Hasemann <rhasemann(at)mac(dot)com> writes:
> What happens if the statement looks like:
> select 1 as FOO, 2 as FOO;  (the database has no probs with that)
> What result will PQfnumber return ????

When in doubt, look in the source code ...

/*
 * PQfnumber: find column number given column name
 *
 * The column name is parsed as if it were in a SQL statement, including
 * case-folding and double-quote processing.  But note a possible gotcha:
 * downcasing in the frontend might follow different locale rules than
 * downcasing in the backend...
 *
 * Returns -1 if no match.  In the present backend it is also possible
 * to have multiple matches, in which case the first one is found.
 */


			regards, tom lane

In response to

pgsql-novice by date

Next:From: Scott MarloweDate: 2004-07-29 07:28:48
Subject: Re: UNIX timestamps
Previous:From: Eduardo Vázquez RodríguezDate: 2004-07-28 23:38:02
Subject: UNIX timestamps

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group