Re: Wrong results with grouping sets

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: Wrong results with grouping sets
Дата
Msg-id CAMbWs4_UkgZp=OC=eeawJn=4ZdZfU-FGjOg_2mhKAdxTyU-HQQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Wrong results with grouping sets  (Richard Guo <guofenglinux@gmail.com>)
Ответы Re: Wrong results with grouping sets
Список pgsql-hackers
On the basis of the parser infrastructure fixup, 0002 patch adds the
nullingrel bit that references the grouping RTE to the grouping
expressions.

However, it seems to me that we have to manually remove this nullingrel
bit from expressions in various cases where these expressions are
logically below the grouping step, such as when we generate groupClause
pathkeys for grouping sets, or when we generate PathTarget for initial
input to grouping nodes.

Furthermore, in set_upper_references, the targetlist and quals of an Agg
node should have nullingrels that include the effects of the grouping
step, ie they will have nullingrels equal to the input Vars/PHVs'
nullingrels plus the nullingrel bit that references the grouping RTE.
In order to perform exact nullingrels matches, I think we also need to
manually remove this nullingrel bit.

Thanks
Richard
Вложения

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Schema variables - new implementation for Postgres 15
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Schema variables - new implementation for Postgres 15