But when install PostgreSQL 8.4.18 it thrown an error:
Problem running post-install step.
Installation may not complete correctly
The database cluster initialization failed.
Looked into the /tmp/bitrock_installer.log, there's an error:
Preparing to Install
Executing su - postgres -c "\"/Library/PostgreSQL/9.1/bin/pg_ctl\" stop -m fast -w -D \"/Library/PostgreSQL/9.1/data\""
Script exit code: 1
Script output:
Script stderr:
su: unknown login: postgres
That's weird why it didn't create necessary account.
So I tried to create the postgres user:
# sudo dscl . -create /users/postgres
Then checked it:
# id postgres
id: postgres: no such user
After google around, they said on Lion, the user _postgres has been precreated and PostgreSQL 9 installed.
So let's delete it:
# sudo dscl . -delete /Users/_postgres
Then installed PostgreSQL 8.4 again, and it worked!
So let's check the psql command path:
# which psql
/usr/bin/psql
We need to change to the new place:
# vi ~/.bash_profile
export PATH=/Library/PostgreSQL/8.4/bin:$PATH
# source ~/.bash_profile
Then check it again
# which psql
Done!