Re: Aggregates containing outer references don't work per spec
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Aggregates containing outer references don't work per spec |
| Дата | |
| Msg-id | 7120.1054828749@sss.pgh.pa.us обсуждение |
| Ответ на | Aggregates containing outer references don't work per spec (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-hackers |
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> When we considered outervar1 as a constant, we could do the aggregate in
> the subquery using computations, but when SUM(outervar1) is computed in
> an above query, combining that with anything that is part of different
> query level makes no sense to me because those variables might not even
> exist at the level that aggregate is being computed.
Sure they will. They can only be outer (up-level) references, else the
parser would not have resolved them in the first place.
If you accept that SUM(localvar + outervar) is a sensible computation,
then I think you must accept that SUM(outervar1 + outervar2) makes sense
too. It's actually the exact same computation, it's just being
referenced from within a sub-query.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера