Re: Possible bug: SQL function parameter in window frame definition
Andrew Gierth <andrew@tao11.riddles.org.uk>
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Alastair McKinley <a.mckinley@analyticsengines.com>
Cc: "pgsql-general\@lists.postgresql.org" <pgsql-general@lists.postgresql.org>
Date: 2019-09-28T15:59:55Z
Lists: pgsql-hackers, pgsql-general
>>>>> "Alastair" == Alastair McKinley <a.mckinley@analyticsengines.com> writes: Alastair> Hi all, Alastair> I noticed this strange behaviour whilst trying to write a Alastair> function for Postgres 11.5 (PostgreSQL 11.5 on Alastair> x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 Alastair> (Red Hat 4.8.5-36), 64-bit) and reduced it to this minimal Alastair> example. Using a function parameter in the window frame Alastair> definition seems to be the cause of the error. [...] Alastair> This appears to be a bug to me. Yes, it's a bug, related to function inlining (the select f(3); is not inlined and therefore works, but the select * from f(3); is being inlined, but the original Param is somehow making it into the final plan rather than being substituted with its value). Looking into why. -- Andrew (irc:RhodiumToad)
Commits
-
Selectively include window frames in expression walks/mutates.
- 3473f81dd2a3 9.4.25 landed
- d2427f11b28d 9.5.20 landed
- 6db0d7f35917 9.6.16 landed
- ede0ab6ccce4 10.11 landed
- 0a445f27909a 11.6 landed
- 0b11dc01922b 12.1 landed
- b7a1c5539ad3 13.0 landed