Re: initdb and "exit_nicely"...

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Jeffery Collins <collins(at)onyx-technologies(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: initdb and "exit_nicely"...
Date: 2000-05-18 23:50:54
Message-ID: Pine.LNX.4.21.0005181457000.349-200000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

I wrote:

> Jeffery Collins writes:
> > It seems like it would be a whole lot "nicer" if initdb only deleted
> > the files that it attempted to create OR if the default was not to
> > delete anything.
>
> Okay, I could go for the former. What do others think?

Here's a patch that might do what you need but I'm somewhat suspicious of
this situation. Recycling an old PGDATA directory is not supported, in
facts it's explicitly prevented with certain checks in initdb. So
apparently you precreated the data directory and put "interesting
things" of your own in it, which is not necessarily something that's
encouraged either.

It does make sense to leave the PGDATA directory and only clean out the
_contents_ on failure, that is, use `rm -rf $PGDATA/*' instead of `rm -rf
$PGDATA' but I doubt that that can be done portably.

--
Peter Eisentraut Sernanders väg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

Attachment Content-Type Size
initdb-patch text/plain 1.6 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2000-05-18 23:58:04 Re: initdb and "exit_nicely"...
Previous Message Peter Eisentraut 2000-05-18 23:50:18 Re: Question about databases in alternate locations...

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2000-05-18 23:58:04 Re: initdb and "exit_nicely"...
Previous Message Peter Eisentraut 2000-05-18 23:50:18 Re: Question about databases in alternate locations...