public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Jelte Fennema-Nio <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: DISCARD ALL does not force re-planning of plpgsql functions/procedures
Date: Sun, 26 May 2024 13:39:30 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAGECzQT6fC=-6Yq2Tj_3ZaUmB+1T=M42DxHyR_X1MPccmOmOKA@mail.gmail.com>
References: <CAGECzQT6fC=-6Yq2Tj_3ZaUmB+1T=M42DxHyR_X1MPccmOmOKA@mail.gmail.com>

Jelte Fennema-Nio <[email protected]> writes:
> I got a report on the PgBouncer repo[1] that running DISCARD ALL was
> not sufficient between connection handoffs to force replanning of
> stored procedures. Turns out that while DISCARD AL and DISCARD PLAN
> reset the plan cache they do not reset the num_custom_plans fields of
> the existing PlanSources. So while the generic plan is re-planned
> after DISCARD ALL, the decision on whether to choose it or not won't
> be changed.

Hm, should it be?  That's hard-won knowledge, and I'm not sure there
is a good reason to believe it's no longer applicable.

Note that any change in behavior there would affect prepared
statements in general, not only plpgsql.

			regards, tom lane






view thread (2+ messages)

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]
  Subject: Re: DISCARD ALL does not force re-planning of plpgsql functions/procedures
  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