If you installed Postgres via Homebrew and then upgraded to Yosemite and now your Postgres doesn’t start than here is the solution.

Turns out that for some reason during the upgrade some directories are removed from $PGDATA.

In the case of a Homebrew installation $PGDATA is /usr/local/var/postgres

Lets create the missing directories:

$ cd /usr/local/var/postgres

$ mkdir {pg_tblspc,pg_twophase,pg_stat_tmp}

You should now be able to start Postgres if you’re using the standard launchctl route:

$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist