Luke Koops <luke(dot)koops(at)entrust(dot)com> writes:
> Heikki is proposing that the file be renamed before it is first deleted.
Indeed, and what I'm saying is that that will still fail if some
unhelpful program is holding the file open without FILE_SHARE_DELETE.
Which is what I understood your case to be ...
regards, tom lane