Re: cleaning up useless pl/pgsql functions

From: "Mendola Gaetano" <mendola(at)bigfoot(dot)com>
To: "Tomasz Myrta" <jasiek(at)klaster(dot)net>, "PGSQL-SQL" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: cleaning up useless pl/pgsql functions
Date: 2003-07-01 03:40:03
Message-ID: 002401c33f82$75081c30$10d4a8c0@mm.eutelsat.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Tomasz Myrta" <jasiek(at)klaster(dot)net> wrote:
> Hi
> Do you have any easy script to remove all pl/pgsql function? After a lot
of
> changes inside "create or replace function..." scripts I have a big mess.
I
> want to remove all user defined pl/pgsql functions and restore some of
them
> from my scripts again.

You shall be able to identify the name of your own function and do:

SELECT 'DROP function ' || proname || ' ('|| oidvectortypes(proargtypes) ||
');' from pg_proc WHERE proname ~ '^sp_';

I identify my own function because the prefix sp_.

I hope that this help you.

Gaetano

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2003-07-01 04:49:30 Re: CREATE SEQUENCE fails in plpgsql function
Previous Message Josh Berkus 2003-07-01 03:32:23 Re: LEAST and GREATEST functions?