Re: Drop Functions Question Again

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Drop Functions Question Again
Дата
Msg-id 27252.1153589361@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Drop Functions Question Again  ("Garcia, Joshua" <Joshua.Garcia@xerox.com>)
Список pgsql-novice
"Garcia, Joshua" <Joshua.Garcia@xerox.com> writes:
> I know this has been asked by other people in the past, but the archives
> don't show that anyone actually answered the question.  Is there any way
> to drop all the custom-created functions I add to the database in one
> command?

Not per se.  If you search the PG archives, you can find examples of
plpgsql functions that people have written to trawl through the system
catalogs and build DROP commands for all objects meeting some criteria
or other.

Also, as of PG 8.1 you can get a textual list of all objects owned by a
given user by trying to drop the user:

regression=# drop user foo;
ERROR:  role "foo" cannot be dropped because some objects depend on it
DETAIL:  owner of function fooey2(integer,integer)
owner of function fooey(integer,integer)
regression=#

(Don't try this in pre-8.1, you'll end up with a lot of orphaned
objects :-()

For a one-shot problem, the easiest thing might be to capture that in
a text file and then edit it down to the command script you need.  If
you expect to do it often then it'd be worth the trouble to write a
function.

            regards, tom lane

В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: initdb fails quietly
Следующее
От: Fred Frazelle
Дата:
Сообщение: Is there a gui front end for this wonderful db program which works like MSAccess?