Re: orphaned PGDATA/base/ subdirectories - Mailing list pgsql-general

From Tom Lane
Subject Re: orphaned PGDATA/base/ subdirectories
Date
Msg-id 9601.1173822275@sss.pgh.pa.us
Whole thread Raw
In response to orphaned PGDATA/base/ subdirectories  (Reece Hart <reece@harts.net>)
Responses Re: orphaned PGDATA/base/ subdirectories  (Reece Hart <reece@harts.net>)
List pgsql-general
Reece Hart <reece@harts.net> writes:
> The manual clearly says that a each row in pg_database will have a
> corresponding subdirectory in base/.  Is the converse also true, ie,
> should every subdir in base/ also have a row in pg_database?  If so, am
> I safe to rm the unreferenced subdirectories?

Yes.

> FWIW, I know that I've interrupted (^C) a few createdb -T operations
> during the course of this installation, and I recently had the disk full
> error. My best guess is that these orphaned directories result from
> those interruptions and failure.

Hm ... 8.1 and up contain code that tries to remove the copied files if a
CREATE DATABASE fails midway through, but it seems it's not working for
you.

It strikes me that if a control-C arrives while the thing is already
doing remove_dbtablespaces(), that would kick it out of that code,
allowing some files to go unreclaimed --- are you in the habit of
banging on ^C repeatedly?  I couldn't reproduce such a problem in a
small amount of testing though.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: New US DST Rules & PostgreSQL
Next
From: Alan Hodgson
Date:
Subject: Re: Questions regarding generating the WAL File.