public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: David G. Johnston <[email protected]>
Cc: Damian Lukowski <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: BUG #19428: Lazy evaluation of type checking in CASE in SQL functions including subqueries no longer works in 18
Date: Thu, 12 Mar 2026 11:46:34 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKFQuwYUnr+fnd_3eoPxxyZc9Yiv4zQ3Pc0-cDHcBFerZj+qPA@mail.gmail.com>
References: <[email protected]>
<[email protected]>
<[email protected]>
<CAKFQuwZN90TwSJJ=1zu88pkkC1e5c_wKDMsO5_849uwa2zDmhQ@mail.gmail.com>
<[email protected]>
<CAKFQuwYUnr+fnd_3eoPxxyZc9Yiv4zQ3Pc0-cDHcBFerZj+qPA@mail.gmail.com>
"David G. Johnston" <[email protected]> writes:
> On Thursday, March 12, 2026, Damian Lukowski <[email protected]> wrote:
>> The `data` table could have millions of rows. Is the planner invoked for
>> every actual call to `func`, or only once before any pages are read?
> IIRC the first five invocations will get replanned using the parameter as a
> constant; then after either every call will be replanned or none will.
Read up on custom vs. generic plans for some more background on this.
That behavior used to apply only to plpgsql functions, but since v18
SQL-language functions do it too.
regards, tom lane
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: BUG #19428: Lazy evaluation of type checking in CASE in SQL functions including subqueries no longer works in 18
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox