Re: [HACKERS] Cannot initdb in cvs tip

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Cannot initdb in cvs tip
Date: 2004-07-28 14:22:42
Message-ID: 4107B6B2.3080801@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32 pgsql-patches

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-07-28 14:27:24 Re: [HACKERS] Cannot initdb in cvs tip
Previous Message Tom Lane 2004-07-28 13:51:58 Re: casting strings to multidimensional arrays yields strange results

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Bruce Momjian 2004-07-28 14:27:24 Re: [HACKERS] Cannot initdb in cvs tip
Previous Message Magnus Hagander 2004-07-28 13:00:13 Re: SSL Connection Issue

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-07-28 14:27:24 Re: [HACKERS] Cannot initdb in cvs tip
Previous Message Tom Lane 2004-07-28 13:51:58 Re: casting strings to multidimensional arrays yields strange results