X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C10074758E6 for ; Thu, 13 Feb 2003 16:09:08 -0500 (EST) Received: from hotmail.com (f179.law12.hotmail.com [64.4.19.179]) by postgresql.org (Postfix) with ESMTP id 20112474E5C for ; Thu, 13 Feb 2003 16:09:08 -0500 (EST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 13 Feb 2003 13:09:09 -0800 Received: from 24.232.209.24 by lw12fd.law12.hotmail.msn.com with HTTP; Thu, 13 Feb 2003 21:09:08 GMT X-Originating-IP: [24.232.209.24] From: "guillermo schulman" To: pgsql-admin@postgresql.org Subject: backup/restore and vacuumdb Date: Thu, 13 Feb 2003 21:09:08 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Message-ID: X-OriginalArrivalTime: 13 Feb 2003 21:09:09.0211 (UTC) FILETIME=[2665FAB0:01C2D3A4] X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/198 X-Sequence-Number: 7396 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 _________________________________________________________________