Re: initdb in C - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: initdb in C
Date
Msg-id 200311081709.hA8H9pm18230@candle.pha.pa.us
Whole thread Raw
In response to Re: initdb in C  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: initdb in C
List pgsql-patches
Peter Eisentraut wrote:
> Andrew Dunstan writes:
>
> > recreating the datadir if we didn't create it initially should be OK in
> > that case, and it makes the code simpler.
>
> That should be avoided, because you'll have trouble recreating the
> original directory with all its properties such as ownership, permissions,
> etc., at least not without making the code anything but simpler.  There
> might even be a situation were you are allowed to delete the directory but
> cannot create a new one.

Recreating the directory only happens on WIN32, where rmdir doesn't
allow you to only delete files and subdirectories and not the parent
directory.  Non-Win32 does rm -rf dir/*.

Is that OK?

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

pgsql-patches by date:

Previous
From: Rod Taylor
Date:
Subject: ALTER TABLE modifications
Next
From: Bruce Momjian
Date:
Subject: Re: initdb in C