backup/restore and vacuumdb
backup/restore and vacuumdb
От:
"guillermo schulman" <gsmiscel@hotmail.com>
Дата:
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 -U -C dbname > /tmp/database.pgdump The restore looks like this: psql -h -U template1 -c "drop database dbname;" psql -h -U 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 _________________________________________________________________