Re: Cannot initdb in cvs tip - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Cannot initdb in cvs tip
Date
Msg-id 4107B6B2.3080801@dunslane.net
Whole thread Raw
In response to Re: Cannot initdb in cvs tip  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Cannot initdb in cvs tip  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Cannot initdb in cvs tip  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

Bruce Momjian wrote:

>Dave, now that we are nearing beta, I think we need to correct the
>initdb problem with removing the directory on Win32.  Would you code
>this up as something that sits in /port/dirmod.c and have both initdb
>and DROP DATABASE call the C routine rather than call rm -r/rmdir?  (I
>think those are the only two.  DROP TABLESPACE?)
>
>

The small wrinkle here is that rmtree needs to make a copy of the file
names before it starts removing things. In the backend case that means
calling palloc() and friends - am I correct in assuming it is reasonable
to do this in whatever context happens to be current when rmtree is
called? (I promise to make it clean up nicely).

>I wanted to keep a solution that was as native to the OS as possible,
>but because we can't do that on Win32 and few people like the unix
>system call to 'rm', it is time to clean it up.
>
>One question --- why is there a sleep loop needed for unlink in your
>patch?
>
>
>
>

We will just be calling the existing pgunlink() (which has a sleep) in
the Windows cases, so this question becomes moot.

cheers

andrew

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] casting strings to multidimensional arrays yields strange results
Next
From: Bruce Momjian
Date:
Subject: Re: Cannot initdb in cvs tip