Обсуждение: deleting procs

Поиск
Список
Период
Сортировка

deleting procs

От
"Jay O'Connor"
Дата:
I want to delete a bunch of procs from the database because I'v stopped
using some and changed the arguments on others.  Is it sufficient to do
something like

    DELETE FROM pg_proc WHERE proname IN (....);

Or do I have to use DROP FUNCTION to clean anything else up?

Thanks

Jay

Re: deleting procs

От
Tom Lane
Дата:
"Jay O'Connor" <joconnor@cybermesa.com> writes:
> I want to delete a bunch of procs from the database because I'v stopped
> using some and changed the arguments on others.  Is it sufficient to do
> something like
>     DELETE FROM pg_proc WHERE proname IN (....);
> Or do I have to use DROP FUNCTION to clean anything else up?

In 7.3, DROP FUNCTION would be better since it would (a) check for any
dependencies you forgot and (b) remove the proc's own dependency links
from pg_depend.  You could imagine doing both of those for yourself
though by looking for pg_depend entries pointing to or from the set
of functions you want to zap.  Other than the dependencies, a plain
(non-aggregate) function has no substructure except its pg_proc row.

            regards, tom lane