From: | "Adam Rich" <adam(dot)r(at)sbcglobal(dot)net> |
---|---|
To: | "'Stefan Schwarzer'" <stefan(dot)schwarzer(at)grid(dot)unep(dot)ch>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Dump schema without the functions |
Date: | 2008-02-01 07:08:16 |
Message-ID: | 019b01c864a1$3b762590$b26270b0$@r@sbcglobal.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
> how can I dump a schema with all tables, but without the functions? Is
> there a way to do it, or do I have to manually drop the functions
> later when having used the pg_restore?
Stef,
You can edit the data between dump and restore, to comment out the
function references. Or, you can use the "-L" argument with pg_restore
to provide a list of the specific items you want to restore.
For example:
pg_dump -Fc mydb > db.dump
pg_restore -l db.dump | grep -v FUNCTION > db.nofunc.dump
pg_restore -d newdb db.nofunc.dump
(assuming the word "FUNCTION" doesn't appear elsewhere in your schema
object names. If it does, you might try appending the schema, such as
grep -v "FUNCTION public")
Adam
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2008-02-01 07:10:13 | Re: Dump schema without the functions |
Previous Message | Tom Lane | 2008-02-01 06:58:36 | Re: Is PostGreSql's Data storage mechanism "inferior"? |