Re: [HACKERS] 6.4 Aggregate Bug and HAVING problems...
От | Vadim Mikheev |
---|---|
Тема | Re: [HACKERS] 6.4 Aggregate Bug and HAVING problems... |
Дата | |
Msg-id | 35F4D150.EFA75826@krs.ru обсуждение исходный текст |
Ответ на | Re: [HACKERS] 6.4 Aggregate Bug (Bruce Momjian <maillist@candle.pha.pa.us>) |
Список | pgsql-hackers |
> Added to TODO: > > * select upper(usename), count(usesysid) from pg_shadow group by 1 fails Fixed. Was broken by new HAVING code... I see another problems in HAVING: 1. drop table x; create table x (a int, b int, c int); insert into x values (1,1,0); insert into x values (1,1,1); select a, min (b) from x group by a having min(b) > c; -- a|min -- -+--- -- 1| 1 -- (1 row) delete from x; vacuum x; insert into x values (1,1,1); insert into x values (1,1,0); select a, min (b) from x group by a having min(b) > c; -- a|min -- -+--- -- (0 rows) Using C-column is illegal! 2. vac=> select a, min (b) from x group by a having min(b) > 0 or a = 0; ^^^^^^^^ ERROR: This could have been done in a where clause!! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ No, couldn't! Using GroupBy expr in having must be allowed. I'm going to change HAVING behaviour... Also, could someone test is HAVING without aggregates disallowed or not: select a, min (b) from x group by a having a = 0; - ??? Vadim
В списке pgsql-hackers по дате отправления: