Re: shrinking physical space used - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: shrinking physical space used
Date
Msg-id 20041114143551.GA23372@svana.org
Whole thread Raw
In response to shrinking physical space used  (Bopolissimus Platypus Jr <bopolissimus.lists@gmail.com>)
List pgsql-general
On Sun, Nov 14, 2004 at 01:50:10PM +0800, Bopolissimus Platypus Jr wrote:
> hello all,
>
> i've got a database that takes up 4G of space.  when i run a script that
> deletes all rows and then vacuum, the data directory gets down to
> around 3-3.5G.  what i'd like is to get a blank database structure that
> really contains no data at all, or any unused space at all.  apparently
> that's not what i'm getting now.  is there a way to get this apart from
> dump, initdb, restore?  i figure that if i could dump/initdb/restore i'd
> probably get a data directory with around 30MB only.

Perhaps you should use TRUNCATE (the SQL command) rather than DELETE.
It'll probably work better... You're probably still seeing the space
the indexes are using.
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: "Gary L. Burnore"
Date:
Subject: Re: I'm about to release the next postgresql RFD.
Next
From: Mike Cox
Date:
Subject: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX