From: Scott Petersen <scottpetersen@softhome.net>
To: pgsql-sql@postgresql.org
Subject: Re: Deleting Functions
Date: Thu, 24 Aug 2006 12:35:57 -0600
Message-ID: <44EDF18D.4000605@softhome.net> (raw)
In-Reply-To: <20060823195430.M44644@contactbda.com>
References: <44ECAC88.4060208@softhome.net>
<20060823195430.M44644@contactbda.com>
Thanks for those who responded. It works fine and lasts a long time.
The following script does NOT require any editing. It simply executes
and works.
\pset format unaligned
\pset fieldsep ''
\pset footer
\t
\o drops.sql
select 'drop function ' || nspname || '.' || proname || '(' ||
pg_catalog.oidvectortypes(p.proargtypes) || ') CASCADE;' from
pg_proc p join pg_namespace b on (p.pronamespace=b.oid) where
nspname='public';
\o
\i drops.sql
Scott.
Jim Buttafuoco wrote:
> Scott,
>
> I use the following query with psql \o option. Change the schema name from public to whatever. I am sure you could put
> this into a plpgsql function using execute as well.
>
>
> Jim
>
> \o drops.sql
> select 'drop function ' || nspname || '.' || proname || '(' || pg_catalog.oidvectortypes(p.proargtypes) || ');' from
> pg_proc p join pg_namespace b on (p.pronamespace=b.oid) where nspname='public';
> \o
> \!vi drops.sql # <<remove the fluff from the query
> \i drops.sql
>
>
>
>
>
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: scottpetersen@softhome.net
Subject: Re: Deleting Functions
In-Reply-To: <44EDF18D.4000605@softhome.net>
* 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