Re: [GENERAL] ALTER FUNCTION

From: Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>
To: Sascha Ziemann <szi(at)khs-ag(dot)de>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] ALTER FUNCTION
Date: 1999-12-02 13:08:08
Message-ID: 38466F38.E10C3889@albourne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sascha Ziemann 1999-12-02 13:15:16 Re: [GENERAL] ALTER FUNCTION
Previous Message Sascha Ziemann 1999-12-02 13:02:13 CREATE TRIGGER ON UPDATE