pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: guillermo schulman <gsmiscel@hotmail.com>
To: pgsql-admin@postgresql.org
Subject: backup/restore and vacuumdb
Date: Thu, 13 Feb 2003 21:09:08 +0000
Message-ID: <F179lXlUfd557zYWOSZ00027501@hotmail.com> (raw)

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





_________________________________________________________________





Message-ID: <F179lXlUfd557zYWOSZ00027501@hotmail.com>
Permalink:  ../F179lXlUfd557zYWOSZ00027501@hotmail.com/
Also on:    postgresql.org/message-id/F179lXlUfd557zYWOSZ00027501@hotmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: gsmiscel@hotmail.com
  Subject: Re: backup/restore and vacuumdb
  In-Reply-To: <F179lXlUfd557zYWOSZ00027501@hotmail.com>
  References: <F179lXlUfd557zYWOSZ00027501@hotmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox