Re: Are multiple selects of the same field allowed

From: Kristis Makris <kristis(dot)makris(at)datasoft(dot)com>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Are multiple selects of the same field allowed
Date: 2002-02-20 15:36:28
Message-ID: 1014219388.1044.122.camel@leonidas
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

>
> Hmm both field have the same field name "id" and the driver
> couldn't distinguish them. Couldn't you change the query like
> "select id, id as id2 from WaterResourec"
> ?
>

I certainly could, at a great inconvinience of modifying sources of a
huge application that was behaving "normally" so far. I noticed that the
command-line psql client succesfully reports a column's value twice if
instructed to do so:

# select usesysid, usesysid from pg_user;
usesysid | usesysid
----------+----------
26 | 26
27 | 27
33 | 33
...

How is that implementation different from what I'm trying to achieve
using the .GetField() function? In other languages (e.g. perl using
DBD:Pg) it is possible to get a result of a row, and index in it the
column whose data are to be retrieved. Can't the GetField() be
implemented to function internally in a similar fashion where it marks
which column names it has "visited" already so it moves to the next in
the case of duplicate column names? Or most importantly, why was the
v7.01.0008 driver handling this correctly, while v7.01.0010 isn't? Was a
significant change in an attempt to remain ODBC compliant (or similar)
made that would absolutely, 100% forbid using .GetField() twice on the
same field name? Why is there such a restriction now all of the sudden,
and is that restriction necessary?

Thanks,
-Kristis

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Jean-Michel POURE 2002-02-20 16:20:43 Re: UTF-8 data migration problem in Postgresql 7.2
Previous Message Tatsuo Ishii 2002-02-20 15:15:53 Re: UTF-8 data migration problem in Postgresql 7.2