Re: conditional query in where has name collision. bug?

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: conditional query in where has name collision. bug?
Дата
Msg-id 87oau9n8lz.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на conditional query in where has name collision. bug?  (bill wilson <bill.wilson.home@gmail.com>)
Список pgsql-hackers
>>>>> "bill" == bill wilson <bill.wilson.home@gmail.com> writes:
bill> This a toy example from a 'upsert' script that appends new data:bill> select a from (select 1 as a) as t1 where
notexists (selectbill> true from (select 2 as a) t2 where a=a) ;bill>  abill> ───bill> (0 rows) 
bill> Please tell me this a bug. We can see in the first querybill> without naming the tables that 'a=a' uses table t2
forbothbill> columns. 

Of course it's not a bug. The column "a" in the inner scope hides the
column "a" in the outer scope, as explicitly required by the spec
(6.6 <identifier chain> in sql2008).

--
Andrew (irc:RhodiumToad)



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

Предыдущее
От: bill wilson
Дата:
Сообщение: conditional query in where has name collision. bug?
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Minor improvement in lock.sgml