Re: Disc space usage

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matthew Wakeling <matthew(at)flymine(dot)org>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Disc space usage
Date: 2008-10-08 14:01:05
Message-ID: 28838.1223474465@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Matthew Wakeling <matthew(at)flymine(dot)org> 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2008-10-08 14:38:01 Re: Disc space usage
Previous Message Matthew Wakeling 2008-10-08 14:00:24 Re: Disc space usage