pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Lowell Hought <lowell.hought@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18950: pgsql function that worked in Postgresql 16 does not return in Postgresql 17
Date: Sat, 07 Jun 2025 22:07:59 -0400
Message-ID: <81946.1749348479@sss.pgh.pa.us> (raw)
In-Reply-To: <75D714EA-CD1E-4F80-A2E8-29E378EC2200@gmail.com>
References: <e9eb5136fb60188fc61c110e9706709fc13638e0.camel@cybertec.at>
	<75D714EA-CD1E-4F80-A2E8-29E378EC2200@gmail.com>

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





view thread (20+ messages)  latest in thread

Message-ID: <81946.1749348479@sss.pgh.pa.us>
Permalink:  ../81946.1749348479@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/81946.1749348479@sss.pgh.pa.us

 · 

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: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, lowell.hought@gmail.com, laurenz.albe@cybertec.at, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18950: pgsql function that worked in Postgresql 16 does not return in Postgresql 17
  In-Reply-To: <81946.1749348479@sss.pgh.pa.us>

* 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