Thread: initdb: directory not empty issue

initdb: directory not empty issue

From
Jeffrey Quinn
Date:
Hi,

Don't know if this is a bug or more of a feature request, but here goes:
It would appear that by default initdb refuses to configure a database
within a directory that already contains files/directories.  I understand
that this is desirable in most cases.

The problem, however, is that this will fail if I am trying to enable a
separate filesystem as the data location.  It's rather annoying to have
to remove a lost+found directory (or other files), init the db, and then
remake lost+found (and restore other files).  How about a --force
flag?  I reckon if an admin is willing to type out that, s/he can take
the responsibility of the consequences.

And of course: fantastic work on release 7.4, and postgreSQL in general!

Cordially,
Jeff Quinn

--
-----------------------------------------------------------
Jeffrey Quinn                           jquinn@cs.usfca.edu
Shaman | UNIX Journeyman        http://cs.usfca.edu/~jquinn
-----------------------------------------------------------

Re: initdb: directory not empty issue

From
Tom Lane
Date:
Jeffrey Quinn <jquinn@cs.usfca.edu> writes:
> The problem, however, is that this will fail if I am trying to enable a
> separate filesystem as the data location.  It's rather annoying to have
> to remove a lost+found directory (or other files), init the db, and then
> remake lost+found (and restore other files).  How about a --force
> flag?

Why not create a /data directory just below the filesystem root, and use
that?

I believe it's generally considered that root should own filesystem
mount points, so using a filesystem root directory directly as the PG
data directory seems like bad practice.

            regards, tom lane