pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Matthew Wakeling <matthew@flymine.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: Disc space usage
Date: Wed, 08 Oct 2008 09:16:50 -0400
Message-ID: <27956.1223471810@sss.pgh.pa.us> (raw)
In-Reply-To: <alpine.DEB.1.10.0810081238380.15851@aragorn.flymine.org>
References: <alpine.DEB.1.10.0810081238380.15851@aragorn.flymine.org>

Matthew Wakeling <matthew@flymine.org> writes:
> One of our build servers recently ran out of disc space while trying to 
> copy an entire database. This led me to investigate the database cluster, 
> which is stored on a RAID array with a total size of 1TB. Running a query 
> to list all databases and their sizes did not add up to the amount of 
> space being used by Postgres, so I had a look at the pgsql/base directory. 
> It appears that there are a few large directories that do not correspond 
> to any database. I wonder if these have been left behind accidentally by 
> Postgres.

Anything under $PGDATA/base that doesn't correspond to a live row in
pg_database is junk.  The interesting question is how it got that way,
and in particular how you seem to have managed to have repeated
instances of it.

I gather that you're in the habit of using CREATE DATABASE to copy
large existing databases, so the most likely theory is that these are
leftovers from previous failed copy attempts.  Now CREATE DATABASE
does attempt to clean up if its copying fails, but there are various
ways to break that, for instance hitting control-C partway through the
cleanup phase.  So I'm wondering if maybe that's been done a few times.

What PG version is this, anyway?

			regards, tom lane



view thread (11+ messages)  latest in thread

Message-ID: <27956.1223471810@sss.pgh.pa.us>
Permalink:  ../27956.1223471810@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27956.1223471810@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, matthew@flymine.org
  Subject: Re: Disc space usage
  In-Reply-To: <27956.1223471810@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox