>> Is there a way to explictly flush cached plans ? Is there a way to
>> prevent the caching of the plan in the stored procedure ?
>
> You can prevent plan caching in PL/pgSQL by using EXECUTE. See the
> "Executing Dynamic Commands" section in the PL/pgSQL chapter of the
> documentation.
Thanks! I suppose that (rewriting all PL/pgSQL stored procedures which
might use tables which could be modified to do an EXECUTE instead of a
plain query) will do.
Thanks everyone for your help! :-)
NB: I'd recommend writing a large 'warning' somewhere in the PL/pgsql doc
about this because loosing data is really scary