Re: initdb in C - Mailing list pgsql-patches

From Tom Lane
Subject Re: initdb in C
Date
Msg-id 12452.1068312477@sss.pgh.pa.us
Whole thread Raw
In response to Re: initdb in C  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: initdb in C  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
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?

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: initdb in C
Next
From: Bruce Momjian
Date:
Subject: Re: [pgsql-hackers-win32] initdb in C