Re: DISCARD ALL does not force re-planning of plpgsql functions/procedures - Mailing list pgsql-hackers

From Tom Lane
Subject Re: DISCARD ALL does not force re-planning of plpgsql functions/procedures
Date
Msg-id 3206.1716745170@sss.pgh.pa.us
Whole thread Raw
In response to DISCARD ALL does not force re-planning of plpgsql functions/procedures  (Jelte Fennema-Nio <postgres@jeltef.nl>)
Responses Re: DISCARD ALL does not force re-planning of plpgsql functions/procedures
Re: DISCARD ALL does not force re-planning of plpgsql functions/procedures
List pgsql-hackers
Jelte Fennema-Nio <postgres@jeltef.nl> 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



pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: DISCARD ALL does not force re-planning of plpgsql functions/procedures
Next
From: Jelte Fennema-Nio
Date:
Subject: Re: DISCARD ALL does not force re-planning of plpgsql functions/procedures