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>
Subject: Re: Possible bug: SQL function parameter in window frame definition
Date: Sat, 28 Sep 2019 16:59:55 +0100
Message-ID: <87tv8wmn1i.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <DB6PR0202MB2904E7FDDA9D81504D1E8C68E3800@DB6PR0202MB2904.eurprd02.prod.outlook.com>
References: <DB6PR0202MB2904E7FDDA9D81504D1E8C68E3800@DB6PR0202MB2904.eurprd02.prod.outlook.com>
>>>>> "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)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: andrew@tao11.riddles.org.uk, a.mckinley@analyticsengines.com
Subject: Re: Possible bug: SQL function parameter in window frame definition
In-Reply-To: <87tv8wmn1i.fsf@news-spur.riddles.org.uk>
References: <DB6PR0202MB2904E7FDDA9D81504D1E8C68E3800@DB6PR0202MB2904.eurprd02.prod.outlook.com> <87tv8wmn1i.fsf@news-spur.riddles.org.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox