Macports, Postgresql 9, Lion and su: no directory

In the off chance you’re getting the following message while attempting to install postgresql on your mac running lion.

su: no directory

when running this command

sudo su - postgres’

¬†after you’ve installed postgresql server via macports and initialized the database, etc. What worked for me is uninstalling postgresql server, running the following command and then restarting my machine

sudo dscl . -delete /Users/_postgres

After reboot, went through the same exact motions for installing postgresql server on my machine and everything went as expected.

Short URL for this post: