Saturday, October 26, 2013

Install PostgreSQL 8.4 on OS X Mountain Lion

Because a developer needs to use PostgreSQL 8.4 on his new MacBook Pro running OS X Mountain Lion v10.8.3. So I downloaded and installed PostgreSQL as usual.

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

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


Tuesday, October 22, 2013

Eclipse jee-europa and Run Jetty Run

Today I setup a new MacBook Pro for a new employee.

After setup Eclipse jee-europa and Run-Jetty-Run, then opened the Run Configurations to create new configuration under the Jetty Webapp, but it didn't create a new configuration as expected. Did nothing and no error at all. Tried with other kinds like Java Application, they worked.

Google around didn't help, so I looked back the Run-Jetty-Run site and tried the old version, then that worked.