Brand new Macbook, script stops after PG installation at the point where the pg is started:
initdb: directory "/usr/local/var/postgres" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/usr/local/var/postgres" or run initdb
with an argument other than "/usr/local/var/postgres".
Script proceeds along successfully after I rm -rf /usr/local/var/postgres and rerun laptop again.
rm -rf /usr/local/var/postgres
I also had this issue on a laptop setup.
What should the behavior be? Does this mean Mavericks is shipping with postgres now?
OS X started shipping Postgres with Lion. I'm not totally sure if it still is, but I really doubt that the built-in version uses /usr/local/var/postgres. It's possible that something earlier in the laptop script is somehow initializing that directory, or that we're trying to setup postgres twice.
It looks like the postgres formula runs initdb. I would guess that's a recent addition and when we try to run it ourselves (as may have been previously required) we get this error. I say we remove our initdb line, or at least make it conditional.
We run brew update, so we can rely on having the latest formulae. That means that it should be safe to just remove the initdb line.
Remove initdb, fixes #182
The latest Homebrew formula runs this as part of post-install.