Re: Are multiple selects of the same field allowed

Поиск
Список
Период
Сортировка
От Kristis Makris
Тема Re: Are multiple selects of the same field allowed
Дата
Msg-id 1014219388.1044.122.camel@leonidas
обсуждение исходный текст
Ответ на Re: Are multiple selects of the same field allowed  (Hiroshi Inoue <Inoue@tpf.co.jp>)
Список 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


В списке pgsql-odbc по дате отправления:

Предыдущее
От: Jean-Michel POURE
Дата:
Сообщение: Re: [HACKERS] UTF-8 data migration problem in Postgresql 7.2
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] UTF-8 data migration problem in Postgresql 7.2