Skip site navigation (1) Skip section navigation (2)

Dump and Reload process

From: Chris Gamache <cgg007(at)yahoo(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Dump and Reload process
Date: 2004-01-30 17:28:59
Message-ID: 20040130172859.3625.qmail@web13806.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-admin
I'm having some issues dumping a database from 7.2, reloading it to 7.4.

I'm using the 7.4 pg_dump. The problem I'm having is an issue of internal
object dependancies. For instance I have a_function that uses b_function. The
a_function gets dumped in first, and errors out because b_function hsan't been
created yet. I've found an ugly workaround: dump the schema first, and run the
sql through multiple times until all the various objects are created. Then
insert the data after.

Here are the dump comands that I used:

pg_dump --create --compress 9 --file=/vol1/work/db_schema_dump-040130.gz
--username=postgres --host=localhost --port=5432 -s mydata &

pg_dump --create --compress 9 --file=/vol1/work/db_data_dump-040130.gz
--username=postgres --host=localhost --port=5432 -a mydata &

There must be a better way! Thoughts?

CG

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

Responses

pgsql-admin by date

Next:From: rep34Date: 2004-01-30 17:36:10
Subject: Test Suite
Previous:From: Goulet, DickDate: 2004-01-30 15:42:42
Subject: Re: hung postmaster when client machine dies?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group