Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 10B1C37C07E for ; Wed, 8 Oct 2008 11:01:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 42128-08-2 for ; Wed, 8 Oct 2008 11:01:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B401C37C00F for ; Wed, 8 Oct 2008 11:01:12 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m98E16Mk028839; Wed, 8 Oct 2008 10:01:06 -0400 (EDT) To: Matthew Wakeling cc: pgsql-performance@postgresql.org Subject: Re: Disc space usage In-reply-to: References: <27956.1223471810@sss.pgh.pa.us> Comments: In-reply-to Matthew Wakeling message dated "Wed, 08 Oct 2008 14:46:49 +0100" Date: Wed, 08 Oct 2008 10:01:05 -0400 Message-ID: <28838.1223474465@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200810/36 X-Sequence-Number: 31617 Matthew Wakeling writes: > On Wed, 8 Oct 2008, Tom Lane wrote: >> Anything under $PGDATA/base that doesn't correspond to a live row in >> pg_database is junk. > So I can delete it? Might be safer to stop the db server while I do that > though. In principle, at least, you shouldn't need to --- there shouldn't be any buffers representing such files. >> What PG version is this, anyway? > Postgres 8.3.0 You should consider an update to 8.3.4. A quick look in the post-8.3.0 CVS logs shows a couple of possibly relevant fixes: 2008-04-18 13:05 tgl * src/: backend/commands/dbcommands.c, include/port.h, port/dirmod.c (REL8_3_STABLE): Fix rmtree() so that it keeps going after failure to remove any individual file; the idea is that we should clean up as much as we can, even if there's some problem removing one file. Make the error messages a bit less misleading, too. In passing, const-ify function arguments. 2008-04-16 19:59 tgl * src/: backend/access/nbtree/nbtree.c, backend/access/nbtree/nbtutils.c, backend/access/transam/xlog.c, backend/commands/dbcommands.c, backend/port/ipc_test.c, backend/storage/ipc/ipc.c, include/access/nbtree.h, include/storage/ipc.h, include/utils/elog.h (REL8_3_STABLE): Repair two places where SIGTERM exit could leave shared memory state corrupted. (Neither is very important if SIGTERM is used to shut down the whole database cluster together, but there's a problem if someone tries to SIGTERM individual backends.) To do this, introduce new infrastructure macros PG_ENSURE_ERROR_CLEANUP/PG_END_ENSURE_ERROR_CLEANUP that take care of transiently pushing an on_shmem_exit cleanup hook. Also use this method for createdb cleanup --- that wasn't a shared-memory-corruption problem, but SIGTERM abort of createdb could leave orphaned files lying around. regards, tom lane