Re: [HACKERS] SELECT ... AS ... names in WHERE/GROUP BY/HAVING

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: [HACKERS] SELECT ... AS ... names in WHERE/GROUP BY/HAVING
Дата
Msg-id Pine.LNX.4.21.9912162008200.5199-100000@localhost.localdomain
обсуждение исходный текст
Ответ на SELECT ... AS ... names in WHERE/GROUP BY/HAVING  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 1999-12-15, Tom Lane mentioned:

> Next question is, do we want to leave the code as-is, or tighten up
> the parser to reject AS-names and column numbers in GROUP BY?
> It seems to me we should change it, because there are cases where the
> existing code will do the wrong thing according to the SQL spec.
> If "foo" is a column name and also an AS-name for something else,
> "GROUP BY foo" should group on the raw column according to the spec,
> but right now we will pick the SELECT result value instead.

The AS-names are way too convenient to drop them. In the particular
example of ambiguity you could send a notice or a reject it. (What does
ORDER BY foo do in this case? Same problem.)

Perhaps it's really time for the --enable-sql option. :)

-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden




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

Предыдущее
От: Lamar Owen
Дата:
Сообщение: Re: [HACKERS] ordering RH6.1
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] Re: [PATCHES] createdb/dropdb fixes