By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,702 Members | 1,268 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,702 IT Pros & Developers. It's quick & easy.

Postgres dump utility

P: n/a
Does anyone know of a way to get the output that pg_dump provides, but split
in pieces? What I would like is one file with just the schema, one file
with just the data, and one file with just indexes. To restore the data I
would then:

psql DB < schema.sql
psql DB < data.sql
psql DB < indexes.sql

This would make large schema changes much easier since you wouldn't have to
wade through the GB's of data to find the table definition statements.

Doing two dumps, one for schema and one for data, *almost* does the trick,
but because the indexes will then be created before copying the data in, the
restore operation takes eons :-(

Anyone?

Thx,
Glen Parker
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
"Glen Parker" <gl******@nwlink.com> writes:
Does anyone know of a way to get the output that pg_dump provides, but split
in pieces?


It might work to dump into -Fc format and then use pg_restore to extract
subsets of the data. See pg_restore's -l and -L options.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.