Thread: Function cache regeneration

Function cache regeneration

From
Hubert FONGARNAND
Date:
Hi,<br /><br /> I'm looking for a way to regenerate the plpgsql function cache, without CREATE OR REPLACE function or
restartingdatabase...<br /> Sometimes, tables could be dropped and recreated, and then all our function working on
thesetables failed...<br /> In fact we've more than 100 functions in our intranet database, and we don't want nor
recreatingall of them nor restarting the database... <br /><br /> Is there a way to do this in SQL?<br /><br />
Thanks<br/><br /> Hubert FONGARNAND<br /><table cellpadding="0" cellspacing="0" width="100%"><tr><td><pre>_____ _    
_           _       _   ____  _         __  __ _             
 
|  ___(_) __| |_   _  ___(_) __ _| | / ___|| |_ __ _ / _|/ _(_)_ __   __ _ 
| |_  | |/ _` | | | |/ __| |/ _` | | \___ \| __/ _` | |_| |_| | '_ \ / _` |
|  _| | | (_| | |_| | (__| | (_| | |  ___) | || (_| |  _|  _| | | | | (_| |
|_|   |_|\__,_|\__,_|\___|_|\__,_|_| |____/ \__\__,_|_| |_| |_|_| |_|\__, |
                                                                     |___/ 
</pre><br /><br /></td></tr></table> _______________________________________________<br />Ce message et les �ventuels
documentsjoints peuvent contenir des informations confidentielles.<br />Au cas o� il ne vous serait pas destin�, nous
vousremercions de bien vouloir le supprimer et en aviser imm�diatement l'exp�diteur. Toute utilisation de ce message
nonconforme � sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est
formellementinterdite.<br />Les communications sur internet n'�tant pas s�curis�es, l'int�grit� de ce message n'est pas
assur�eet la soci�t� �mettrice ne peut �tre tenue pour responsable de son contenu. 

Re: Function cache regeneration

From
"Merlin Moncure"
Date:
On 3/22/07, Hubert FONGARNAND <informatique.internet@fiducial.fr> wrote:
>
>  Hi,
>
>  I'm looking for a way to regenerate the plpgsql function cache, without CREATE OR REPLACE function or restarting
database...
>  Sometimes, tables could be dropped and recreated, and then all our function working on these tables failed...
>  In fact we've more than 100 functions in our intranet database, and we don't want nor recreating all of them nor
restartingthe database...
 
>
>  Is there a way to do this in SQL?
>

there is technique to recompile pl/pgsql command, etc taking the
function name or oid i think. search the archives...

plan invalidation is coming to 8.3 i think.

merlin


Re: Function cache regeneration

From
Tom Lane
Date:
Hubert FONGARNAND <informatique.internet@fiducial.fr> writes:
> I'm looking for a way to regenerate the plpgsql function cache, without
> CREATE OR REPLACE function or restarting database...

You don't have to restart the whole database, just start fresh connections.
        regards, tom lane