Re: Dump schema without the functions - Mailing list pgsql-general

From Adam Rich
Subject Re: Dump schema without the functions
Date
Msg-id 019b01c864a1$3b762590$b26270b0$@r@sbcglobal.net
Whole thread Raw
In response to Dump schema without the functions  (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>)
List 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







pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Is PostGreSql's Data storage mechanism "inferior"?
Next
From: Tom Lane
Date:
Subject: Re: Dump schema without the functions