Re: strange behavior, hoping for an explanation

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: strange behavior, hoping for an explanation
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C2071A1524@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на strange behavior, hoping for an explanation  (Chris Travers <chris.travers@gmail.com>)
Список pgsql-general
Chris Travers wrote:
> I have found recently that tables in certain contexts seem to have a
> name pseudocolumn.  I was wondering if there is any documentation as
> to what this is and what it signifies.
>
> postgres=# CREATE table TEST2 (a text, b text);
> CREATE TABLE
> postgres=# INSERT INTO test2 values ('aaaa', 'bbbb');
> INSERT 0 1
> postgres=# select t.name FROM test2 t;
>     name
> -------------
>  (aaaa,bbbb)
> (1 row)
>
> However:
>
>
> postgres=# select name FROM test2 t;
> ERROR:  column "name" does not exist
> LINE 1: select name FROM test2 t;
>
> This isn't making any sense to me.  Are there certain circumstances
> where a tuple is cast to something like varchar(63)?  Does this pose
> pitfals for any columns named 'name' in other contexts?

I tried to your sample in 9.1.1 and 9.2devel, and both gave me
  ERROR:  column t.name does not exist
as expected.

Yours,
Laurenz Albe

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

Предыдущее
От: pasman pasmański
Дата:
Сообщение: Re: strange behavior, hoping for an explanation
Следующее
От: Dmitriy Igrishin
Дата:
Сообщение: Re: PQexecParams with binary resultFormat vs BINARY CURSOR