Re: initdb and "exit_nicely"... - Mailing list pgsql-general

From Tom Lane
Subject Re: initdb and "exit_nicely"...
Date
Msg-id 5501.959140265@sss.pgh.pa.us
Whole thread Raw
In response to Re: initdb and "exit_nicely"...  (Lincoln Yeoh <lylyeoh@mecomb.com>)
Responses Re: initdb and "exit_nicely"...  (Lincoln Yeoh <lylyeoh@mecomb.com>)
Re: initdb and "exit_nicely"...  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
Lincoln Yeoh <lylyeoh@mecomb.com> writes:
> I think initdb should NOT touch existing PGDATA directories. Let the user
> take the responsibility for rm -rf or moving/renaming. If PGDATA exists it
> should leave it, or at worst rename it to PGDATA.old.1 (increasing number
> or maybe datetime).

Well, we can't quite do that, because PGDATA may very well be a
subdirectory of a root-owned directory --- so initdb *must* be willing
to cope with the case that PGDATA directory has been created for it
by root.

The idea I suggested a couple of days ago was that initdb should refuse
to run if PGDATA exists and is nonempty.  Sound reasonable?

            regards, tom lane

pgsql-general by date:

Previous
From: Lamar Owen
Date:
Subject: Re: initdb and "exit_nicely"...
Next
From: Tom Lane
Date:
Subject: Re: PostgreSQL cleartext passwords