The PostGreSQL initdb utility checks that the target data directory specified with -D is empty, and fails if it is not, with no option to override. This causes initdb to fail when used on a data directory that is a filesystem mount point if it contains a dump snapshot directory (".snap" directory). Adding initdb options is well beyond the scope of a port patch. I thought this simple workaround may be acceptable. Fix: Tell initdb to ignore the ".snap" directory as it does for "." and ".." already. OR Add an option to initdb that allows it to run on a data directory that is not empty. For the first option, this simple patch to pgcheckdir.c does the trick: --------------- cut How-To-Repeat: Create a fresh filesystem, mount it at /usr/local/pgsql, and attempt to run initdb.
Responsible Changed From-To: freebsd-ports-bugs->pgsql over to port-specific list
I had a chat with a couple of the folks on IRC (#PostgreSQL/FreeNode) to get their feedback, and seanc passed it on to the upstream mailing lists with a slightly more refined version of the patch ignoring all dot dirs. The thread is here for reference: http://www.postgresql.org/message-id/A37DC83F-75AA-4850-8261-AD16B104F044@chittenden.org
Forgive the top-reply. After reading the discussion, I'm in favor of the "philosophically correct" approach rather than the usually-technically-correct approach. That is, display the warning, but let the sysadmin/dba do what they need/want to do and trust that, most of the time, they know what they're doing. As the most interesting man might say, I don't always have PGDATA as a mount point for another filesystem, but when I do... On 2/6/2013 15:29, Kubilay Kocak wrote: > I had a chat with a couple of the folks on IRC (#PostgreSQL/FreeNode) > to get their feedback, and seanc passed it on to the upstream mailing > lists with a slightly more refined version of the patch ignoring all > dot dirs. The thread is here for reference: > > http://www.postgresql.org/message-id/A37DC83F-75AA-4850-8261-AD16B104F044@chittenden.org >
this was updated upstream here: http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=17f15239325a88581bb4f9cf91d38005f1f52d69 and can be tested in the next release that includes this change -jgh -- Jason Helfman FreeBSD Committer | http://people.freebsd.org/~jgh | The Power To Serve
Is this PR still relevant?
Guessing this was about PostgreSQL 9.2. Closing for lack of feedback. If the problem still exists, please reopen or file a new report against adequate version.