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