| От | Tom Lane |
|---|---|
| Тема | Re: sum() over (partition by order) question |
| Дата | |
| Msg-id | 16310.1230764265@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | sum() over (partition by order) question ("Pavel Stehule" <pavel.stehule@gmail.com>) |
| Список | pgsql-hackers |
"Pavel Stehule" <pavel.stehule@gmail.com> writes:
> wrong
> postgres=# select a, b, sum(a) over (w) from foo window w as
> (partition by b order by a ROWS BETWEEN UNBOUNDED PRECEDING AND
> UNBOUNDED FOLLOWING);
Should be "over w". "over (w)" is a <window specification> that
modifies an existing window, not just a reference, and in particular
that means we don't copy the framing clause; see SQL2008 7.11
general rule 1) b) i) 6).
Hmm... I think 7.11 syntax rule 10) e) actually wants us to throw an
error for this case, not just silently ignore the referenced window's
framing clause. I had thought that was just being overly anal, but now
it seems that this case can result in user confusion, so maybe we'd
better throw the error after all.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера