Shouldn't this be invalid?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Shouldn't this be invalid?
Дата
Msg-id 12529.925603767@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
I notice that both 6.4.2 and 6.5-current make no complaint if I do

create table t1 (a int4, b int4);

select a+1,b from t1 group by b;

Shouldn't this draw "Illegal use of aggregates or non-group column in
target list"?  It does if there's an aggregate nearby:

select sum(a),a+1,b from t1 group by b;
ERROR:  Illegal use of aggregates or non-group column in target list
select sum(a),b from t1 group by b;
[ no problem ]

I think the system is simply failing to apply the check in the case
where there's a GROUP BY but no aggregate functions.  Comments?
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] views and group by (formerly: create view as selec
Следующее
От: Bruce Momjian
Дата:
Сообщение: query dumping core