Re: initdb in C

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, 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:27:57
Message-ID: 12452.1068312477@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32 pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-11-08 17:38:37 Re: [pgsql-hackers-win32] initdb in C
Previous Message Tom Lane 2003-11-08 17:18:20 Re: initdb in C

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Bruce Momjian 2003-11-08 17:38:37 Re: [pgsql-hackers-win32] initdb in C
Previous Message Tom Lane 2003-11-08 17:18:20 Re: initdb in C

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-11-08 17:38:37 Re: [pgsql-hackers-win32] initdb in C
Previous Message Tom Lane 2003-11-08 17:18:20 Re: initdb in C