Recently, I've been working on a project that relies heavily on Postgresql and I've come to appreciate its flexibility. New features like hstore, json and plv8js allow for rapid application development. Index-only scans and native streaming replication make Postgresql even more appealing in a traditional context. After reading about the forthcoming features of 9.3, I went in search of a way to install 9.3 beta 1 along side my existing 9.2 installation.
The magic begins with petere's homebrew-postgresql formulae. The first step is to follow the README and brew tap the repository.
Next, install postgresql-9.3.
This will install postgresql into
/usr/local/opt/postgres-9.3. It will not symlink any of the executables in
/usr/local/bin because the formula was added via brew tap. This means that the existing brew-based postgres executables won't be overwritten by 9.3. It also means that there's a little more legwork involved in getting everything setup. Currently, I'm just calling the executables directly via their full path, but you could add
/usr/local/opt/postgresql-9.3/bin to your PATH and avoid lots of typing.
At this point, we need to initialize the database.
Once that finishes you can start postgres manually using the following command.
If you want postgres to automatically start on boot, use the following plist to create a LaunchAgent.
Save this plist into
/usr/local/opt/postgresql-9.3/homebrew.mxcl.postgresql.plist. Then symlink this file into
~/Library/LaunchAgents using the following command.
Lastly, start up postgres immediately using launchctl.
Check out the 9.3 beta 1 release notes or Postgres 9.3 feature highlight: JSON data generation for more information on some interesting new features.