OSX MacPorts install of postgres

Following their instructions to initialise the database, you get a complaing about /dev/null.

This is because the default postgres user is installed with a shell of /dev/null.

To change it, forget all the Unix stuff you know about administering users and do this

sudo dscl . -change /Users/postgres UserShell /dev/null /bin/sh

Or if you want to check first, check that the user exists sudo dscl . -list /Users UniqueID

And then check the postgres user sudo dscl . read /users/postgres