Tom,
If you first delete the file and it goes into deletion pending, the=
n subsequent attempts to rename or delete will fail.
Heikki is proposing that the file be renamed before it is first del=
eted.
-Luke
> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: Wednesday, September 09, 2009 3:06 PM
> To: Heikki Linnakangas
> Cc: Luke Koops; pgsql-bugs@postgresql.org
> Subject: Re: [BUGS] BUG #5038: WAL file is pending deletion
> in pg_xlog folder, this interferes with WAL archiving.
>
> Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> > One option is to rename the file before deleting it.
>
> I was under the impression that renaming would fail in the
> same cases where deletion fails, ie something else holding
> the file open ...
>
> regards, tom lane
>