Could not remove file messages

Lists: pgsql-novice
From: Mija Lee <mija(at)scharp(dot)org>
To: pgsql-novice(at)postgresql(dot)org
Subject: Could not remove file messages
Date: 2007-08-30 17:15:22
Message-ID: 200708301715.l7UHFLka013163@brood2.pc.scharp.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Hi:

We've been getting a message in our logs on a semi-regular basis in response to a cron job that drops
and recreates a number of databases using the dropdb command. The message indicates that a directory
cannot be removed, and sure enough, when I look in the file system, the 11210840 directory exists,
although it's empty. When I check the oids of my databases, 11210840 doesn't exist which is not
surprising given the successful drop database message at the end.

I was wondering why this might be happening and if there is an easy, safe way to clean up those
directories.

We're running 8.1.4. Relevant log messages below:

01:45:59 PDT WARNING: could not remove file or directory "base/11210840": File exists
01:45:59 PDT WARNING: could not remove database directory "base/11210840"
01:45:59 PDT LOG: transaction ID wrap limit is 2147484146, limited by database "postgres"
01:46:00 PDT LOG: duration: 3754.761 ms statement: DROP DATABASE cdstest;

Thanks!
Mija


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mija Lee <mija(at)scharp(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Could not remove file messages
Date: 2007-08-30 19:07:43
Message-ID: 7642.1188500863@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Mija Lee <mija(at)scharp(dot)org> writes:
> We're running 8.1.4. Relevant log messages below:

> 01:45:59 PDT WARNING: could not remove file or directory "base/11210840": File exists
> 01:45:59 PDT WARNING: could not remove database directory "base/11210840"

Hm, on what platform? There are known reasons for this to happen on
Windows (basically, that removing files can be delayed if the bgwriter
process still has them open). I'm not sure to what extent that's been
fixed in later PG releases. But you really ought to be running 8.1.9
anyway ...

regards, tom lane