Alexander Lakhin <exclus...@gmail.com> writes: > 15.11.2020 04:11, Justin Pryzby wrote: >> Your patch introduces a "loops", but doesn't use it to escape the loop.
> Indeed, this is my mistake. Please look at the corrected patch (now that > code corresponds to the pgwin32_open() as intended). So what you're saying (and what the buildfarm seems to confirm, since we are still seeing "Permission denied" failures from time to time, eg [1]) is that all that code that bed90759f added to deal with delete-pending is just junk, because we never get that far if the file is delete-pending. So shouldn't we remove all of it? (That's lines 214-276 in win32stat.c, plus some earlier declarations that would now be unneeded.) I'd be kind of inclined to change pgwin32_open() to use microsoft_native_stat, as well, because these two functions really ought to be handling this exactly alike. regards, tom lane [1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=fairywren&dt=2020-11-18%2018%3A02%3A04