Re: [GENERAL] ALTER FUNCTION - Mailing list pgsql-general

From Adriaan Joubert
Subject Re: [GENERAL] ALTER FUNCTION
Date
Msg-id 38466F38.E10C3889@albourne.com
Whole thread Raw
In response to ALTER FUNCTION  (Sascha Ziemann <szi@khs-ag.de>)
List pgsql-general
Just drop the function, drop all triggers that use the function,
re-create the function and recreate all triggers. If the function is
called by other PL functions, you need to drop and re-install those as
well. If you keep them all in a big file, every one preceded by drop,
you can just reload the file (with \i into psql) whenever you have
changed something. No need to dump any data.

Adriaan



>
> UPDATE pg_proc SET prosrc='SQL statement' WHERE proname LIKE
> 'functionname';
>
> seems to work for SQL queries at least. I doubt it's recommended,
> though!
>
> >
> > are there plans for an ALTER FUNCTION statement for Postgresql?  I
> > think functions are completely unuseable, when it is not possible to
> > change the definition of a function.  A bugfix in a function
> requires
> > the export of all data, a redefinition of the function and a
> complete
> > reimport.  Or is there a simpler way?

pgsql-general by date:

Previous
From: Sascha Ziemann
Date:
Subject: CREATE TRIGGER ON UPDATE
Next
From: Sascha Ziemann
Date:
Subject: Re: [GENERAL] ALTER FUNCTION