Re: BUG #13853: initdb to UNC path

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: NBoardman(at)idtus(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13853: initdb to UNC path
Date: 2016-01-07 19:20:58
Message-ID: 14649.1452194458@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

John R Pierce <pierce(at)hogranch(dot)com> writes:
> On 1/7/2016 8:14 AM, NBoardman(at)idtus(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pavel Stehule 2016-01-07 21:35:48 Re: BUG #13850: Need a parameter added similar to "edb_stmt_level_tx"
Previous Message John R Pierce 2016-01-07 18:49:19 Re: BUG #13853: initdb to UNC path