Re: [HACKERS] initdb mkdir_p() doesn't work

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] initdb mkdir_p() doesn't work
Date: 2003-11-23 19:57:16
Message-ID: 3FC1111C.6040802@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan wrote:

>
>
> Peter Eisentraut wrote:
>
>> Here is what I get:
>>
>> peter ~$ pg-install/bin/initdb pg-install/var/data
>> ...
>> creating directory pg-install/var/data ... initdb: failed
>>
>> No points for details in the error message here either.
>>
>> If I create pg-install/var first, then it work.
>>
>
> I will check it out. I know I spent quite some time making sure this
> worked, but I might have missed something obvious. I wonder if it is
> platform specific?
>
>

I don't remember why the code is the way it is. The failure appears to
be before we ever get to mkdir_p(). I can't see any reason right now why
we can't call mkdir_p() in all cases. The attached patch does that (and
makes the code slightly simpler as a result). I tested it with one
element and 2 element existant and nonexistant paths, and it appeared to
work for all of them.

cheers

andrew

Attachment Content-Type Size
initdb-mkdir.patch text/plain 861 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-11-23 20:02:05 Re: initdb mkdir_p() doesn't work
Previous Message Gaetano Mendola 2003-11-23 19:54:54 Re: First generic/redhatish RPM's uploaded to ftp.postgresql.org.

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-11-23 20:02:05 Re: initdb mkdir_p() doesn't work
Previous Message Andrew Dunstan 2003-11-23 19:09:51 Re: initdb mkdir_p() doesn't work