Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2022-Aug-30, Matheus Martin wrote:
>> Good idea on using an actual prepared statement but unfortunately it didn't
>> produce any different result.
> I should have also mentioned to try the EXPLAIN EXECUTE six times and
> see if the last one produces a different plan. That's when it switches
> from planning every time to planning with generic arguments, as I
> recall.
In recent versions you can bypass that with
SET plan_cache_mode = force_generic_plan;
regards, tom lane