Switch to postgres user on Mac
That looks consistent with the postgres user not having a login shell. Try sudo -u postgres bash
PostgreSQL is integrated in Server.app available through the App Store in Mountain Lion.
You would have this file:/Library/Server/PostgreSQL/Config/org.postgresql.postgres.plist
You can sudo:
sudo -u _postgres psql template1
Or connect:
psql -h localhost -U _postgres postgres