X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 546D69FB219 for ; Thu, 27 Jul 2006 17:37:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 52700-07 for ; Thu, 27 Jul 2006 17:37:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 6EAEB9FB215 for ; Thu, 27 Jul 2006 17:36:26 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k6RKa54P004531; Thu, 27 Jul 2006 16:36:05 -0400 (EDT) To: Andrew Sullivan cc: pgsql-sql@postgresql.org Subject: Re: Disk is full, what's cool to get rid of? In-reply-to: <20060727163727.GC27075@phlogiston.dyndns.org> References: <44C8E7EB.3040608@myemma.com> <20060727163727.GC27075@phlogiston.dyndns.org> Comments: In-reply-to Andrew Sullivan message dated "Thu, 27 Jul 2006 12:37:27 -0400" Date: Thu, 27 Jul 2006 16:36:05 -0400 Message-ID: <4529.1154032565@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.037 tagged_above=0 required=5 tests=AWL, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200607/341 X-Sequence-Number: 25915 Andrew Sullivan writes: > If the data isn't critical, you maybe could truncate a table to clear > enough space. Deleting anything under pg_xlog is more or less > guaranteed to mean your database is garbage. If you're desperate you could shut down the postmaster, run pg_resetxlog, restart the postmaster. This would cut xlog contents to the minimum --- however, they'd probably soon grow back to whatever they are now, so it's not much of a long-term solution. It might give you some breathing room to look for other places to trim though. If the database hasn't been maintained well then you likely are suffering from table bloat and/or index bloat. A desperation measure for fixing that is drop all indexes, vacuum full, recreate all indexes. (There are other procedures you may find recommended, such as CLUSTER, but they have transient disk-space requirements that you're not gonna be able to afford when your back is to the wall.) regards, tom lane