Re: initdb mkdir_p() doesn't work

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: initdb mkdir_p() doesn't work
Date: 2003-11-30 05:07:34
Message-ID: 200311300507.hAU57YX06122@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > Tom Lane wrote:
> >> AFAICS mkdatadir() shouldn't consider subdir == NULL as a reason to
> >> fail rather than trying mkdir_p.
>
> > Right. In fact, I can't see any good reason to call mkdir and then
> > mkdir_p at all. See my patch from this afternoon.
>
> I'm unsure about that. I liked the original idea of only trying mkdir_p
> when plain mkdir() had failed with ENOENT. I am not convinced your
> proposed patch will behave desirably under all error cases. In
> particular, mkdir_p seems rather dependent on knowing just which errno
> codes will get returned --- which is okay for its heritage as BSD-only
> code, but how well will it port? Better to only invoke it when we have
> reason to think it can help.

I am inclined to apply the existing patch and see if we get actual errno
failures from port testing.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-11-30 05:07:44 Re: [HACKERS] initdb mkdir_p() doesn't work
Previous Message Bruce Momjian 2003-11-30 04:44:45 Re: [BUGS] 7.4: CHAR padding inconsistency

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-11-30 05:07:44 Re: [HACKERS] initdb mkdir_p() doesn't work
Previous Message Bruce Momjian 2003-11-30 05:02:37 Re: PATCH: Uninitialized variable usage in contrib/pg_autovacuum