Re: BUG #13853: initdb to UNC path - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #13853: initdb to UNC path
Date
Msg-id 14649.1452194458@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #13853: initdb to UNC path  (John R Pierce <pierce@hogranch.com>)
Responses Re: BUG #13853: initdb to UNC path
List pgsql-bugs
John R Pierce <pierce@hogranch.com> writes:
> On 1/7/2016 8:14 AM, NBoardman@idtus.com wrote:
>> fixing permissions on existing directory //localhost/Users/nboardman/test
>> ... ok
>>
>> creating subdirectories ... initdb: could not create directory
>> "//localhost/Users": File exists

Hm.  AFAICS, this failure must have occurred inside pg_mkdir_p, and what
it implies is that stat(2) either failed entirely for "//localhost/Users",
or claimed it isn't a directory.  Either one seems more like a system
problem than our problem.

> does it work if you leave out the \\localhost part?   using network
> paths for database storage is NOT recommended.

This is true, and it's not an unreasonable bet that stat() is misbehaving
because it's a network path.

Having said that, I wonder why initdb is coded to use pg_mkdir_p rather
than plain mkdir for creating subdirectories after the datadir has been
created.  There is basically no advantage there, and there's certainly
scope for things to go wrong, as this example shows.

            regards, tom lane

pgsql-bugs by date:

Previous
From: John R Pierce
Date:
Subject: Re: BUG #13853: initdb to UNC path
Next
From: Pavel Stehule
Date:
Subject: Re: BUG #13850: Need a parameter added similar to "edb_stmt_level_tx"