Re: BUG #18950: pgsql function that worked in Postgresql 16 does not return in Postgresql 17 - Mailing list pgsql-bugs

From Lowell Hought
Subject Re: BUG #18950: pgsql function that worked in Postgresql 16 does not return in Postgresql 17
Date
Msg-id CAJtAGPpa4yYS6LLO5RHzwe9q7NpHiuuvEX1wVtErpie3EBWZJQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18950: pgsql function that worked in Postgresql 16 does not return in Postgresql 17  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #18950: pgsql function that worked in Postgresql 16 does not return in Postgresql 17
Re: BUG #18950: pgsql function that worked in Postgresql 16 does not return in Postgresql 17
List pgsql-bugs
Yes!  I just changed the parameter as  you suggested and the query returned as expected.
So I guess something changed between version 16 and version 17?  Perhaps the default for that setting?

Lowell

On Sat, Jun 7, 2025 at 9:08 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Lowell Hought <lowell.hought@gmail.com> writes:
> If I run the query outside of the function it works as expected.  But the function never returns.

This isn't that surprising either: a query inside a function is
often translated into a "generic" plan that doesn't depend on
specific parameter values, typically sacrificing runtime to
avoid repeated planning.  Does it get any better if you do
"set plan_cache_mode = force_custom_plan" before running the
function?

                        regards, tom lane

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #18947: TRAP: failed Assert("len_to_wrt >= 0") in pg_stat_statements
Next
From: Lowell Hought
Date:
Subject: Re: BUG #18950: pgsql function that worked in Postgresql 16 does not return in Postgresql 17