Re: Bug about column references within subqueries used in selects

Поиск
Список
Период
Сортировка
От Bort, Paul
Тема Re: Bug about column references within subqueries used in selects
Дата
Msg-id DB106B1B5B8F734B8FF3E155A3A556C20548D7C7@clemail1.tmwsystems.com
обсуждение исходный текст
Ответ на Re: Bug about column references within subqueries used in selects  (NikhilS <nikkhils@gmail.com>)
Список pgsql-hackers
>
>     I don't think so...the columns of update_test are visible to the
>     scalar subquery...that way you can use fields from 'a'
> to filter the
>     subquery...
>     select a, (select y from supdate_test where x = a) from
> update_test;
>
>
> Yes this is fine, but in "select columnname from tablename"
> using column references of the other involved table is what I
> am objecting to.
>

There's nothing here to object to, the system is acting correctly. Your
column name "b" is ambiguous, and the system takes the column "b" that
exists, rather than returning an error on a column that doesn't exist.
If you were explicit in your column name, you would get an error:

=# select a, (select supdate_test.b from supdate_test) from update_test;
ERROR:  No such attribute supdate_test.b

Regards,
Paul


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

Предыдущее
От: Ranjan Sahoo
Дата:
Сообщение: Benchmarking tools for the Postgres, EDB and Oracle Database
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: What tools do people use to hack on PostgreSQL?