| From: | "guillermo schulman" <gsmiscel(at)hotmail(dot)com> |
|---|---|
| To: | pgsql-admin(at)postgresql(dot)org |
| Subject: | backup/restore and vacuumdb |
| Date: | 2003-02-13 21:09:08 |
| Message-ID: | F179lXlUfd557zYWOSZ00027501@hotmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-admin |
I'm doing some migration script from mysql database to an existing
postgresql database. Everytime I want to test it, I want to get the postgres
"destination" database to the same situation it was before the last script
was run.
I am doing a backup with pgdump and restoring by droping the database and
running the script generated by pgdump.
The backup looks like this:
pg_dump -h <hostname> -U <username> -C dbname > /tmp/database.pgdump
The restore looks like this:
psql -h <hostname> -U <username> template1 -c "drop database dbname;"
psql -h <hostname> -U <username> template1 < /tmp/database.pgdump
But this aproach is taking a long time and the database is becoming slower
every time.
So: which is the best backup/restore method to apply in this case? And about
the performance, I'm using vacuumdb but I don't know when to do it. Any
idea?
Thanks
_________________________________________________________________
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2003-02-13 21:42:33 | Re: 'update' as action of 'insert' rule: permission denied |
| Previous Message | Aleksander Kmetec | 2003-02-13 20:57:30 | Locale problems |