Search Postgresql Archives

Re: Drop all overloads of a function without knowing parameter types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Evan Martin <postgresql@xxxxxxxxxxxxxxxxx> writes:
> Is there any easy way to drop a function (all overloads of it) without 
> knowing the parameter types?

Something along the lines of

do $$
declare fname text;
begin
for fname in select oid::regprocedure from pg_proc where proname = 'foo' loop
  execute 'drop function ' || fname;
end loop;
end$$;

Adjust WHERE condition to taste.

> If not, it would be good to see it added.

People periodically ask for extensions flavored more or less like this,
but I'm suspicious of building any such thing into the core.  There's too
little commonality in the exact conditions they want to search on.
Leaving it at the level of a scripting problem, as above, allows arbitrary
customization of the search condition.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux