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