Re: Pinned files at Windows

2019-06-04 Thread Konstantin Knizhnik
On 04.06.2019 3:18, Michael Paquier wrote: On Mon, Jun 03, 2019 at 11:37:30PM +0300, Konstantin Knizhnik wrote: but without success because ERROR_DELETE_PENDING is never returned by Win32. And moreover, stat() doesn't ever return error in this case. Could it be possible to find a reliable wa

Re: Pinned files at Windows

2019-06-03 Thread Michael Paquier
On Mon, Jun 03, 2019 at 11:37:30PM +0300, Konstantin Knizhnik wrote: > but without success because ERROR_DELETE_PENDING is never returned by Win32. > And moreover, stat() doesn't ever return error in this case. Could it be possible to find a reliable way to detect that? Cloberring errno with an in

Re: Pinned files at Windows

2019-06-03 Thread Konstantin Knizhnik
On 03.06.2019 22:15, Robert Haas wrote: On Thu, May 30, 2019 at 3:25 AM Konstantin Knizhnik wrote: If call of stat() is succeed, then my assumption is that the only reason of GetFileAttributesEx failure is that file is deleted and returning ENOENT error code in this case is correct behavior.

Re: Pinned files at Windows

2019-06-03 Thread Robert Haas
On Thu, May 30, 2019 at 3:25 AM Konstantin Knizhnik wrote: > If call of stat() is succeed, then my assumption is that the only reason > of GetFileAttributesEx > failure is that file is deleted and returning ENOENT error code in this > case is correct behavior. In my experience, the assumption "th

Re: Pinned files at Windows

2019-05-30 Thread Konstantin Knizhnik
On 29.05.2019 22:20, Michael Paquier wrote: On Mon, May 27, 2019 at 05:52:13PM +0300, Konstantin Knizhnik wrote: Postgres is opening file with FILE_SHARE_DELETEĀ  flag which makes it possible to unlink opened file. But unlike Unixes, the file is not actually deleted. You can see it using "dir"

Re: Pinned files at Windows

2019-05-29 Thread Michael Paquier
On Mon, May 27, 2019 at 05:52:13PM +0300, Konstantin Knizhnik wrote: > Postgres is opening file with FILE_SHARE_DELETEĀ  flag which makes it > possible to unlink opened file. > But unlike Unixes, the file is not actually deleted. You can see it using > "dir" command. > And stat() function also doesn

Re: Pinned files at Windows

2019-05-27 Thread Konstantin Knizhnik
On 27.05.2019 12:26, Konstantin Knizhnik wrote: Hi, hackers. There is the following problem with Postgres at Windows: files of dropped relation can be blocked for arbitrary long amount of time. Such behavior is caused by two factors: 1. Windows doesn't allow deletion of opened file. 2. Post