I was going to post this yesterday, but some might have thought that it was a joke. April 1st is always an annoying day to communicate real information.
If you have been fond of the way Debian and Ubuntu manage multiple PostgreSQL versions in parallel, you can now have the same on OS X with Homebrew:
brew tap petere/postgresql
brew install postgresql-9.2
# etc.
brew install --HEAD postgresql-common
postgresql-common
is the same code as in Debian, only mangled a little.
Now you have all the client programs symlinked through pg_wrapper
, and
you can use the server management tools such as:
pg_createcluster 9.2 main
pg_ctlcluster 9.2 main start
pg_lsclusters
Let me know if you find this useful.
Links:
You probably forgot the "brew tap" command.
ReplyDeleteFirst, thanks so much for the work on these tools.
ReplyDeleteI've installed two versions of postgres via brew - 9.1 and 9.3; then installed postgresql-common. Built clusters as expected PGCLUSTER=9.1/foo; PGCLUSTER=9.1/bar. However, when I execute psql against these, the client is in 9.3 with the server in 9.1:
09:21:40 ~$ PGCLUSTER=9.1/foo psql postgres
psql (9.3.5, server 9.1.14)
Tried various incarnations of linking pg_wrapper to the psql in the 9.1/bin folder, did not make a difference. Wondering if the postgresql-common is predisposed to use the latest version of postgres available in brew? If not, what magic can I use to get the server and client versions to align.
Thanks in advance.
postgresql-common always selects the latest psql by default, per https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=639108 .
DeleteHow would one go about installing postgis in this setup? The postgis brews require one of the main postgresql brews, which conflict with the postgresql-common install. (Sorry if this is a duplicate comment - it wasn't clear if it submitted the first time I tried)
ReplyDeleteI recommend using Pex: https://github.com/petere/pex
Delete