Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls

Поиск
Список
Период
Сортировка
От Nicholas White
Тема Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls
Дата
Msg-id CA+=vxNbcnZxDqVg4EX8oqMyFxU5XV2ron-MaE7_PZ8V-W-gDYA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Ответы Re: Request for Patch Feedback: Lag & Lead Window Functions Can Ignore Nulls  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
> pg_get_viewdef() needs to be updated

Ah, good catch - I've fixed this in the attached. I also discovered that there's a parent-child hierarchy of WindowDefs (using relname->name), so instead of cloning the WindowDef (in parse_agg.c) if the frameOptions are different (e.g. by adding the ignore-nulls flag) I create a child of the WindowDef and override the frameOptions. This has the useful side-effect of making pg_get_viewdef work as expected (the previous iteration of the patch produced a copy of the window definintion, not the window name, as it was using a nameless clone), although the output has parentheses around the view name:

> lag(i.i, 2) IGNORE NULLS OVER (w) AS lagged_by_2

I've updated the test cases accordingly. Thanks -

Nick
Вложения

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

Предыдущее
От: Luis Carvalho
Дата:
Сообщение: PL/Lua (was: plpython implementation)
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: pg_ctl and -h/help