Bug in aggregates in windowing context
От | David Fetter |
---|---|
Тема | Bug in aggregates in windowing context |
Дата | |
Msg-id | 20090909222419.GA20190@fetter.org обсуждение исходный текст |
Ответы |
Re: Bug in aggregates in windowing context
Re: Bug in aggregates in windowing context |
Список | pgsql-hackers |
Folks, Elein Mustain mentioned this, and I came up with a short repro. The SQL standard does not distinguish between what's available to aggregates normally and in the windowing context. However... SELECT count(DISTINCT i) FROM (VALUES (1),(2),(3),(1)) AS s(i);count ------- 3 (1 row) SELECT count(DISTINCT i) OVER () FROM (VALUES (1),(2),(3),(1)) AS s(i); ERROR: DISTINCT is not implemented for window functions LINE 1: SELECT count(DISTINCT i) OVER () FROM (VALUES (1),(2),(3),(1... ^ I see the error set up in src/backend/parser/parse_func.c, but no real reasoning why. Anyhow, I think it's a bug and needs back-patching. Cheers, David. -- David Fetter <david@fetter.org> http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fetter@gmail.com Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate
В списке pgsql-hackers по дате отправления: