Re: [GENERAL] PG_RESTORE and database size

2006-01-27 Thread Tom Lane
"Marcus Couto" <[EMAIL PROTECTED]> writes:
> Here's a basic question. On working with backing up and restoring it =
> seems like if I keep on doing it in a row, the backup file size keeps on =
> increasing in size. It almost doubles in size for every backup/restore. =
> I want the restore the backup to overwrite the database and not add to =
> it. Is there another procedure I'm missing or a parameter I'm not using =
> right with pg_restore and pg_dump?

Why are you restoring into a live database?  It sounds to me like you
are probably ignoring a lot of object-already-exists errors from
pg_restore and then having it add on duplicate data to the tables.

Usually people drop the database and recreate it empty before running
pg_restore.  There is a switch named --clean or something like that
to make pg_restore emit DROP commands before recreating objects, but
hardly anyone uses it because it's usually slower than dropping the
whole database at once.

regards, tom lane

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [GENERAL] PG_RESTORE and database size

2006-01-27 Thread Richard Huxton

Marcus Couto wrote:

Here's a basic question. On working with backing up and restoring it
seems like if I keep on doing it in a row, the backup file size keeps
on increasing in size. It almost doubles in size for every
backup/restore. I want the restore the backup to overwrite the
database and not add to it. Is there another procedure I'm missing or
a parameter I'm not using right with pg_restore and pg_dump?


If I were to ask you about vacuum-ing would you know what I was talking 
about? If not, check the manuals and read up on the topic.


--
  Richard Huxton
  Archonet Ltd

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


[GENERAL] PG_RESTORE and database size

2006-01-27 Thread Marcus Couto



Here's a basic question. On working with 
backing up and restoring it seems like if I keep on doing it in a row, 
the backup file size keeps on increasing in size. It almost doubles in size for 
every backup/restore. I want the restore the backup to overwrite the database 
and not add to it. Is there another procedure I'm missing or a parameter I'm not 
using right with pg_restore and pg_dump? 
 
Thank you for any help.