It appears to me - based primarily on what I see on Stack Overflow rather than direct Mac use experience - that PostgreSQL packaging on Mac OS X is a real mess.
There are at least four widely-used competing package systems:
- An ancient version pre-installed in some Mac OS X versions
- Postgres.app from Heroku; and
- The EnterpriseDB One-Click installer for Pg
Fink and MacPorts packages also exist, but seem to have either fallen into disuse or "just work" so I don't see breakage reports about them.
This makes supporting PostgreSQL on Mac OS X really painful. I'm not the only one who thinks so, though I don't agree with the solution proposed in that post.
I see *daily* questions about Pg on Mac OS X on Stack Overflow's PostgreSQL tag, usually related to installs not working, conflicts and
PATH problems caused by multiple installs, Mac OS X upgrades (or sometimes just minor updates) breaking things, etc.
The problems don't boil down to a simple and common set of causes. There are launchd problems,
PATH problems both at runtime (wrong
psql) and build time (wrong
pg_config), library path problems causing the wrong
libpq to be found, endless different kinds of Ruby/Rails problems with the
pg gem, etc. The #1 cause seems to be updates to Mac OS X, and the #2 multiple copies of PostgreSQL on one system without proper
PATHs set up.
The group of users with the most problems appears to be Ruby/Rails people having issues compiling the `Pg` gem and connecting to the right version of Pg. How much of that is simply that Rails is popular and often used by inexperienced people is hard to guess.
The second big problem appears to be people who install several different packagings of PostgreSQL on one system and get exceedingly confused. See this recent SO question for just one example. Even uninstalling is complicated, as the user has to know what they installed and how before they have a hope of uninstalling it, leading to SO questions like this. Not that Linux is much better from the uninstallation standpoint, going by all the problems new users on Ubuntu/
pg_wrapper systems seem to have purging and clean-installing Pg.
My question is: What can we do about all this? Can Pg proper improve this situation? Why aren't people using the EnterpriseDB installer? Or are they, and we just see problem reports from the Homebrew and Postgres.app people? Is this just "life on Apple" where Apple might break any non-Apple software on the machine and you have to put up with it? Or are these various Pg packagings doing things wrong, things that can be fixed so that Apple updates stop breaking them?
Should we be pushing Apple to run their bundled PostgreSQL on a different port, so they don't break people's reasonable expectation to be able to install Pg and run it on port 5432?
Is the answer documentation - or, more likely, will people just not read it? Do the various installers need to check for other Pg installs and warn the user?
(A related question I want to write more about soon is the problem currently faced by people who want to bundle Pg in their application installers. Many of them are using the EnterpriseDB installer in silent mode, but I think that's quite harmful as it'll leave users with a PostgreSQL install they don't know the passwords for and didn't set up themselves. If they go to install Pg themselves later problems will arise.)