pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mendola Gaetano <mendola@bigfoot.com>
To: Tomasz Myrta <jasiek@klaster.net>
To: PGSQL-SQL <pgsql-sql@postgresql.org>
Subject: Re: cleaning up useless pl/pgsql functions
Date: Tue, 1 Jul 2003 05:40:03 +0200
Message-ID: <002401c33f82$75081c30$10d4a8c0@mm.eutelsat.org> (raw)
References: <3F00A7F8.80107@klaster.net>

"Tomasz Myrta" <jasiek@klaster.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





view thread (5+ messages)

Message-ID: <002401c33f82$75081c30$10d4a8c0@mm.eutelsat.org>
Permalink:  ../002401c33f82$75081c30$10d4a8c0@mm.eutelsat.org/
Also on:    postgresql.org/message-id/002401c33f82$75081c30$10d4a8c0@mm.eutelsat.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mendola@bigfoot.com, jasiek@klaster.net
  Subject: Re: cleaning up useless pl/pgsql functions
  In-Reply-To: <002401c33f82$75081c30$10d4a8c0@mm.eutelsat.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox