Re: initdb in C - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: initdb in C
Date
Msg-id 200311081739.hA8Hdfi21314@candle.pha.pa.us
Whole thread Raw
In response to Re: initdb in C  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > 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/*.
>
> I think we should forget about invoking rm as a subprocess at all, and
> just do the recursive directory walk and unlinks for ourselves.  We
> already have code to do this for copy in copydir.c, and unlink would not
> be any longer.  We will probably be forced into implementing database
> removal for ourselves rather than by 'rm' hacks anyway as soon as
> tablespaces come to pass; so why contort initdb's behavior for a very
> transient implementation savings?

If we want to do that, fine, but I don't want to force the change just
for Win32.

--
  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: Bruce Momjian
Date:
Subject: Re: [pgsql-hackers-win32] initdb in C
Next
From: Bruce Momjian
Date:
Subject: Re: initdb in C