Re: initdb in C

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: initdb in C
Date: 2003-11-08 17:09:51
Message-ID: 200311081709.hA8H9pm18230@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32 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(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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-11-08 17:10:23 Re: initdb in C
Previous Message Rod Taylor 2003-11-08 16:55:06 ALTER TABLE modifications

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Bruce Momjian 2003-11-08 17:10:23 Re: initdb in C
Previous Message Andrew Dunstan 2003-11-08 16:51:13 Re: initdb in C

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-11-08 17:10:23 Re: initdb in C
Previous Message Rod Taylor 2003-11-08 16:55:06 ALTER TABLE modifications