pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #13853: initdb to UNC path
4+ messages / 4 participants
[nested] [flat]

* BUG #13853: initdb to UNC path
@ 2016-01-07 16:14 NBoardman@idtus.com
  2016-01-07 18:49 ` Re: BUG #13853: initdb to UNC path John R Pierce <pierce@hogranch.com>
  0 siblings, 1 reply; 4+ messages in thread

From: NBoardman@idtus.com @ 2016-01-07 16:14 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      13853
Logged by:          Nuri Boardman
Email address:      NBoardman@idtus.com
PostgreSQL version: 9.4.2
Operating system:   Windows 7
Description:        

when i run this command (initdb with UNC path)
pg_ctl initdb -D \\localhost\Users\nboardman\test

i get the following (error) output

The files belonging to this database system will be owned by user
"NBoardman".
This user must also own the server process.

The database cluster will be initialized with locale "English_United
States.1252
".
The default database encoding has accordingly been set to "WIN1252".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory //localhost/Users/nboardman/test
... ok

creating subdirectories ... initdb: could not create directory
"//localhost/User
s": File exists
initdb: removing contents of data directory
"//localhost/Users/nboardman/test"
pg_ctl: database system initialization failed

finally, if this is illegal, the documentation does not indicate the path
has to be a windows path
from http://www.postgresql.org/docs/9.4/static/app-initdb.html

-D directory
--pgdata=directory
This option specifies the directory where the database cluster should be
stored. This is the only information required by initdb, but you can avoid
writing it by setting the PGDATA environment variable, which can be
convenient since the database server (postgres) can find the database
directory later by the same variable.




-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #13853: initdb to UNC path
  2016-01-07 16:14 BUG #13853: initdb to UNC path NBoardman@idtus.com
@ 2016-01-07 18:49 ` John R Pierce <pierce@hogranch.com>
  2016-01-07 19:20   ` Re: BUG #13853: initdb to UNC path Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: John R Pierce @ 2016-01-07 18:49 UTC (permalink / raw)
  To: NBoardman@idtus.com; pgsql-bugs

On 1/7/2016 8:14 AM, NBoardman@idtus.com wrote:
> The following bug has been logged on the website:
>
> Bug reference:      13853
> Logged by:          Nuri Boardman
> Email address:NBoardman@idtus.com
> PostgreSQL version: 9.4.2
> Operating system:   Windows 7
> Description:
>
> when i run this command (initdb with UNC path)
> pg_ctl initdb -D \\localhost\Users\nboardman\test
>
> i get the following (error) output
>
> The files belonging to this database system will be owned by user
> "NBoardman".
> This user must also own the server process.
>
> The database cluster will be initialized with locale "English_United
> States.1252
> ".
> The default database encoding has accordingly been set to "WIN1252".
> The default text search configuration will be set to "english".
>
> Data page checksums are disabled.
>
> fixing permissions on existing directory //localhost/Users/nboardman/test
> ... ok
>
> creating subdirectories ... initdb: could not create directory
> "//localhost/Users": File exists
> initdb: removing contents of data directory
> "//localhost/Users/nboardman/test"
> pg_ctl: database system initialization failed
>
> finally, if this is illegal, the documentation does not indicate the path
> has to be a windows path
> fromhttp://www.postgresql.org/docs/9.4/static/app-initdb.html

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

the documentation is OS independent, things like 'paths' are OS specific

-- 
john r pierce, recycling bits in santa cruz



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #13853: initdb to UNC path
  2016-01-07 16:14 BUG #13853: initdb to UNC path NBoardman@idtus.com
  2016-01-07 18:49 ` Re: BUG #13853: initdb to UNC path John R Pierce <pierce@hogranch.com>
@ 2016-01-07 19:20   ` Tom Lane <tgl@sss.pgh.pa.us>
  2016-01-07 22:45     ` Re: BUG #13853: initdb to UNC path Nuri Boardman <NBoardman@idtus.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2016-01-07 19:20 UTC (permalink / raw)
  To: John R Pierce <pierce@hogranch.com>; +Cc: NBoardman@idtus.com; 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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #13853: initdb to UNC path
  2016-01-07 16:14 BUG #13853: initdb to UNC path NBoardman@idtus.com
  2016-01-07 18:49 ` Re: BUG #13853: initdb to UNC path John R Pierce <pierce@hogranch.com>
  2016-01-07 19:20   ` Re: BUG #13853: initdb to UNC path Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-01-07 22:45     ` Nuri Boardman <NBoardman@idtus.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Nuri Boardman @ 2016-01-07 22:45 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; John R Pierce <pierce@hogranch.com>; +Cc: pgsql-bugs

This command

pg_ctl.exe initdb -D localhost\Users\nboardman\test
just creates the whole DB locally starting at the current directory, and then going .\localhost\Users\... etc

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us] 
Sent: Thursday, January 07, 2016 2:21 PM
To: John R Pierce
Cc: Nuri Boardman; pgsql-bugs@postgresql.org
Subject: Re: [BUGS] BUG #13853: initdb to UNC path

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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2016-01-07 22:45 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-01-07 16:14 BUG #13853: initdb to UNC path NBoardman@idtus.com
2016-01-07 18:49 ` John R Pierce <pierce@hogranch.com>
2016-01-07 19:20   ` Tom Lane <tgl@sss.pgh.pa.us>
2016-01-07 22:45     ` Nuri Boardman <NBoardman@idtus.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox