On Mon, Sep 6, 2021 at 9:55 AM Tom Lane <t...@sss.pgh.pa.us> wrote: > Andres Freund <and...@anarazel.de> writes: > > I'd be ok to only fix these bugs on e.g. Win10, Win Server 2019, Win Server > > 2016 or such. > > Yeah, particularly if the fix is trivial on the newer systems and > incredibly complicated otherwise. Between the effort needed and > the risk of introducing new bugs, I'm really not excited about > an invasive fix for this.
If DeleteFile() is automatically using FILE_DISPOSITION_POSIX_SEMANTICS by default when possible on recent releases as per the SO link that Andres posted above ("18363.657 definitely has the new behavior"), then that's great news and maybe we shouldn't even bother to try to request that mode ourselves explicitly (eg in some kind of unlink wrapper). Then we'd need just one accomodation for older systems and non-NTFS systems, not two, and I currently think that should be the short and sweet approach shown in 0001-Handle-STATUS_DELETE_PENDING-on-Windows.patch, with some tidying and adjustments per feedback.