Re: BUG #18305: Unexpected error: "WindowFunc not found in subplan target lists" triggered by subqueries

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: BUG #18305: Unexpected error: "WindowFunc not found in subplan target lists" triggered by subqueries
Дата
Msg-id CAApHDvrF+N4tYJLPRvvHirsLo=oiv4VztB3xCLvMLWRuj86OOA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #18305: Unexpected error: "WindowFunc not found in subplan target lists" triggered by subqueries  (Richard Guo <guofenglinux@gmail.com>)
Ответы Re: BUG #18305: Unexpected error: "WindowFunc not found in subplan target lists" triggered by subqueries  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Fri, 22 Mar 2024 at 23:47, Richard Guo <guofenglinux@gmail.com> wrote:
> For back branches, the idea of modifying window_ntile_support() and
> int8inc_support() to reject any non-pseudoconstant args also seems
> reasonable to me.  One thing I noticed is that sometimes it's not easy
> to tell whether the arg is pseudoconstant or not in the support
> functions, because a pseudoconstant is not necessarily being type of
> Const.  For instance, count(1::text) is a CoerceViaIO, and
> ntile(1.0::int) is a FuncExpr.  But these are very corner cases and I
> think we can just ignore them.

I don't think that needs anything special aside from constant folding.

I've attached a more complete version of the patch (0002) and another
patch which is what I'd proposed as a fix for the backbranches (0001).
Note quite a few tests needed to be adjusted because of disabling this
optimisation.

The 0002 patch will require a cat version bump as it adds a field to
WindowFunc.  Ideally, I'd be applying this fix to master, but I
imagine some people might feel we should delay applying a fix like
this until after we branch for v18. Happy to hear people's views on
that.

David

Вложения

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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #18446: Postgres.exe crash observed while installing the application
Следующее
От: David Rowley
Дата:
Сообщение: Re: BUG #17855: Uninitialised memory used when the name type value processed in binary mode of Memoize