Skip site navigation (1) Skip section navigation (2)

restore balloons db size

From: Marc Fromm <Marc(dot)Fromm(at)wwu(dot)edu>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: restore balloons db size
Date: 2008-07-31 15:03:44
Message-ID: (view raw or whole thread)
Lists: pgsql-admin
Does anyone have some insight on why the db size is expanding with each restore?

If I restore all the postgresql databases from pg_dumpall and use the -c to drop databases before restoring them the size of the base directory dramatically increases with each restore (193MB to 355MB to 624MB). If I run vacuumdb, it only drops by a few MB.

If I do the long restore process by:
1. stopping the postmaster
2. deleting all contents in the data folder 3. run initdb -D /var/lib/pgsql/data 4. start the postmaster 5. restore of all databases from the same pg_dumpall the size of the base directory does not balloon.

I have searched online for optimized backup and restore procedures for postgresql, so far all I have found are the documents which are a little vague on the subject.

I must assume there is a better method than my long process that does not bloat the size of the base directory (the databases) as the -c flag seems to do. I tried to use pg_restore but I receive a message stating the pg_dumpall file is an invalid archive.



pgsql-admin by date

Next:From: Tom LaneDate: 2008-07-31 15:48:32
Subject: Re: restore balloons db size
Previous:From: Johann SpiesDate: 2008-07-31 12:14:20
Subject: Re: pgAdmin III

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group