From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Garcia, Joshua" <Joshua(dot)Garcia(at)xerox(dot)com> |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Drop Functions Question Again |
Date: | 2006-07-22 17:29:21 |
Message-ID: | 27252.1153589361@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
"Garcia, Joshua" <Joshua(dot)Garcia(at)xerox(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Dawid Kuroczko | 2006-07-23 18:41:27 | Re: [NOVICE] The name of the game |
Previous Message | Tom Lane | 2006-07-22 17:19:03 | Re: initdb fails quietly |