Re: Checking pgwin32_is_junction() errors

2022-10-11 Thread Thomas Munro
On Thu, Aug 11, 2022 at 10:40 PM wrote: > On 2022-08-11 07:55, Thomas Munro wrote: > >> I checked a few variants: > >> > >> 21.07.2022 15:11 HOME [\??\Volume{GUID}\] > >> 09.08.2022 15:06 Test1 [\\?\Volume{GUID}\] > >> 09.08.2022 15:06 Test2 [\\.\Volume{GUID}\] > >> 09.0

Re: Checking pgwin32_is_junction() errors

2022-08-11 Thread r . zharkov
On 2022-08-11 07:55, Thomas Munro wrote: I checked a few variants: 21.07.2022 15:11 HOME [\??\Volume{GUID}\] 09.08.2022 15:06 Test1 [\\?\Volume{GUID}\] 09.08.2022 15:06 Test2 [\\.\Volume{GUID}\] 09.08.2022 15:17 Test3 [\??\Volume{GUID}\] 09.08.2022 15:27

Re: Checking pgwin32_is_junction() errors

2022-08-10 Thread Thomas Munro
On Tue, Aug 9, 2022 at 10:59 PM wrote: > On 2022-08-09 05:44, Thomas Munro wrote: > > On Tue, Aug 9, 2022 at 8:30 AM Thomas Munro > > wrote: > >> On Mon, Aug 8, 2022 at 8:23 PM wrote: > >> > "C:/HOME" is the junction point to the second volume on my hard drive - > >> > "\??\Volume{GUID}\" which

Re: Checking pgwin32_is_junction() errors

2022-08-09 Thread r . zharkov
On 2022-08-09 05:44, Thomas Munro wrote: On Tue, Aug 9, 2022 at 8:30 AM Thomas Munro wrote: On Mon, Aug 8, 2022 at 8:23 PM wrote: > "C:/HOME" is the junction point to the second volume on my hard drive - > "\??\Volume{GUID}\" which name pgreadlink() erroneously strips here: > https://github.c

Re: Checking pgwin32_is_junction() errors

2022-08-09 Thread r . zharkov
On 2022-08-09 03:30, Thomas Munro wrote: Then our readlink() emulation removes it again, but in the case of your \??\Volume{GUID} path, created by you, not our symlink() emulation, removing "\??\" apparently makes it unopenable with CreateFile() (I guess that's what fails? What's the error?).

Re: Checking pgwin32_is_junction() errors

2022-08-08 Thread Thomas Munro
On Tue, Aug 9, 2022 at 8:30 AM Thomas Munro wrote: > On Mon, Aug 8, 2022 at 8:23 PM wrote: > > "C:/HOME" is the junction point to the second volume on my hard drive - > > "\??\Volume{GUID}\" which name pgreadlink() erroneously strips here: > > https://github.com/postgres/postgres/blob/7e29a79a46d

Re: Checking pgwin32_is_junction() errors

2022-08-08 Thread Thomas Munro
On Mon, Aug 8, 2022 at 8:23 PM wrote: > initdb on my windows 10 system stopped working after the commit > c5cb8f3b: "Provide lstat() for Windows." > The error message is: creating directory C:/HOME/data ... initdb: > error: could not create directory "C:/HOME": File exists > > "C:/HOME" is the jun

Re: Checking pgwin32_is_junction() errors

2022-08-08 Thread r . zharkov
On 2022-08-06 08:02, Thomas Munro wrote: Pushed. Hmm, this stuff could *really* use a little test framework that's run by check-world, that exercises these various replacement operations. But I also suspect that problems in this area are likely to be due to concurrency. It's hard to make a sim

Re: Checking pgwin32_is_junction() errors

2022-08-05 Thread Thomas Munro
On Fri, Aug 5, 2022 at 9:17 PM Thomas Munro wrote: > Hmm, POSIX says st_link should contain the length of a symlink's > target path, so I suppose we should probably set that even though we > never consult it. Here's a version that does that. I also removed > the rest of the now redundant #ifdef

Re: Checking pgwin32_is_junction() errors

2022-08-05 Thread Thomas Munro
On Thu, Aug 4, 2022 at 9:42 AM Thomas Munro wrote: > On Thu, Aug 4, 2022 at 9:28 AM Andrew Dunstan wrote: > > On 2022-08-01 Mo 16:06, Andrew Dunstan wrote: > > > I'll try it out on fairywren/drongo. > > > They are happy with patches 2, 3, and 4. > > Thanks for testing! > > If there are no objecti

Re: Checking pgwin32_is_junction() errors

2022-08-03 Thread Thomas Munro
On Thu, Aug 4, 2022 at 9:28 AM Andrew Dunstan wrote: > On 2022-08-01 Mo 16:06, Andrew Dunstan wrote: > > I'll try it out on fairywren/drongo. > They are happy with patches 2, 3, and 4. Thanks for testing! If there are no objections, I'll go ahead and commit these later today.

Re: Checking pgwin32_is_junction() errors

2022-08-03 Thread Andrew Dunstan
On 2022-08-01 Mo 16:06, Andrew Dunstan wrote: > On 2022-08-01 Mo 01:09, Thomas Munro wrote: >> On Thu, Jul 28, 2022 at 9:31 PM Thomas Munro wrote: >>> There's one curious change in the draft patch attached: you can't >>> unlink() a junction point, you have to rmdir() it. Previously, things >>>

Re: Checking pgwin32_is_junction() errors

2022-08-01 Thread Andrew Dunstan
On 2022-08-01 Mo 01:09, Thomas Munro wrote: > On Thu, Jul 28, 2022 at 9:31 PM Thomas Munro wrote: >> There's one curious change in the draft patch attached: you can't >> unlink() a junction point, you have to rmdir() it. Previously, things >> that traverse directories without ever calling pgwin

Re: Checking pgwin32_is_junction() errors

2022-07-31 Thread Thomas Munro
On Thu, Jul 28, 2022 at 9:31 PM Thomas Munro wrote: > There's one curious change in the draft patch attached: you can't > unlink() a junction point, you have to rmdir() it. Previously, things > that traverse directories without ever calling pgwin32_is_junction() > would see junction points as S_I

Re: Checking pgwin32_is_junction() errors

2022-07-28 Thread Thomas Munro
Here's a better idea, now that I'm emboldened by having working CI for Windows frankenbuilds, and since I broke some stuff in this area on MSYS[1], which caused me to look more closely at this area. Why don't we just nuke pgwin32_is_junction() from orbit, and teach Windows how to lstat()? We're a

Re: Checking pgwin32_is_junction() errors

2022-04-21 Thread Michael Paquier
On Thu, Mar 24, 2022 at 04:30:26PM +1300, Thomas Munro wrote: > I think it'd be better to add missing_ok and elevel parameters, > following existing patterns. Unfortunately, it can't use the generic > frontend logging to implement elevel in frontend code from its current > location, because pgport

Checking pgwin32_is_junction() errors

2022-03-23 Thread Thomas Munro
Hi, The comment for pgwin32_is_junction() says "Assumes the file exists, so will return false if it doesn't (since a nonexistent file is not a junction)". In fact that's the behaviour for any kind of error, and although we set errno in that case, no caller ever checks it. I think it'd be better