Re: Drop all overloads of a function without knowing parameter types - Mailing list pgsql-general

From Dmitriy Igrishin
Subject Re: Drop all overloads of a function without knowing parameter types
Date
Msg-id CAAfz9KOBJteQ_GFCik5gJaAKrcEkndROddphzohLO+6Dyfu1Gw@mail.gmail.com
Whole thread Raw
In response to Re: Drop all overloads of a function without knowing parameter types  (Evan Martin <postgresql@realityexists.net>)
List pgsql-general



2014-02-03 Evan Martin <postgresql@realityexists.net>:
Thanks for that "oid::regprocedure" trick! A query like this is fairly simple once you know it, but completely non-obvious when you don't.

I'm not sure what conditions others want to search on (couldn't find it in the list archives), but "by qualified function name" seems like the obvious one. If you don't wish to add that to the core, how about a system function that does this and is mentioned in the documentation for DROP FUNCTION? That way, if people have other criteria they can find the function, look at its source and adapt it to their needs. If you don't want to add a function, either, it would be good to at least document this (on the DROP FUNCTION page). Something like "Note: DROP FUNCTION does not allow you to drop a function without knowing its argument types, but you can use the following script to drop all overloads of a given function name..."
The function name (as well as the name of any other database object, such as view or rule)
can have a prefix or suffix. (We are prefix our functions with the class name to consider
them as methods in terms of object-oriented design.) Thus, such system function
for dropping functions should accept something like a regular expression as
it argument.
Moreover, how about other database objects which can be dropped: views, triggers, rules,
domains etc etc. For completeness it is necessary the existence of system functions
for dropping these objects too.
So, I am with Tom here.



--
// Dmitry.

pgsql-general by date:

Previous
From: Sergey Konoplev
Date:
Subject: Re: Drop all overloads of a function without knowing parameter types
Next
From: Sergey Konoplev
Date:
Subject: Re: Drop all overloads of a function without knowing parameter types