I’m seeing reports of a number of issues with PostgreSQL after upgrades of OS X machines to Yosemite (OS X 10.10) that I’m concerned about, so I’m seeking more information about the experiences of PostgreSQL users who’ve done OS X 10.10 upgrades.
I can’t confirm anything yet, but back up all your databases before any upgrade to OS X 10.10. Just in case. (Of course, you do that before any upgrade, but just in case it slipped your mind this time…).
I don’t have access to a Mac because Apple’s policy prevents developers from running OS X for testing and development (or anything else) without buying physical Apple hardware and finding somewhere to run it. So I can’t test most of this myself, and I really need reports from users, or if possible, results of proactive testing by OS X users. I’ve also submitted a bug to Apple (#18719563) but don’t anticipate any action from that alone.
Meanwhile, I strongly recommend that Apple users install their own PostgreSQL – Homebrew, Macports, Postgres.app or the EDB installer – and use that instead of Apple’s built-in PostgreSQL. This was always the preferred option, and it’s what most users already did. If you’re one of the ones who was using the built-in PostgreSQL, switch now.
OS X built-in PostgreSQL deleted on update
Some OS X users appear to use the PostgreSQL version built-in to OS X for their own data, rather than installing a new PostgreSQL. Some of them, in addition to using the binaries, also use a PostgreSQL cluster (database instance) that’s created by OS X for the use of Server.app, instead of initdbing their own.
On releases prior to Yosemite the PostgreSQL provided by Apple was on the default PATH, though not necessarily running by default. It seems that on Yosemite it’s been removed; there’s no longer any /usr/bin/psql, etc. As far as I can tell Server.app now bundles PostgreSQL within the application bundle instead.
Some user reports suggest that on upgrade, the Apple-controlled databases in the new release are migrated into the new cluster managed by Server.app then the old cluster is stopped or possibly deleted – a colleage checked the upgrade script and found rm -rf /var/pgsql in it.
The PostgreSQL data directory in prior releases was /private/var/pgsql (and /var is a symlink to /private/var) or /Library/Server/PostgreSQL/Data.
The main symptom you’ll see is:
Connection refused
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
… but this issue is only one of many, many possible causes of that message.
OS X updater may be removing empty directories
I’m seeing a number of reports that suggest that the OS X updater may be removing empty directories. This causes problems with PostgreSQL, which expects to have an empty pg_twophase, pg_tblspc, and often pg_stat_tmp as a part of normal operation.
- Yosemite (OSX 10.0) problems with Postgresql
- Mac OS X Yosemite Upgrade & PostgreSQL
- `pg_tblspc` missing after installation of OS X Yosemite
- … and so, so many posts on Holdem Manager and Poker Tracker forums.
It looks like working around this is a simple matter of mkdiring the directories and setting appropriate permissions, but it’s a concern that it’s happening at all.
Server.app 3.2.1 upgrade issues
I’m also seeing reports that the patch release 3.2.1 for Server.app upgrades its private bundled PostgreSQL from 9.2.8 to 9.3.4, which seems to be causing some users issues.
If you’ve used the PostgreSQL bundled in Server.app to initdb a new cluster, this will render it inaccessible until you find and install a compatible PostgreSQL 9.2.
- I Cannot Access PostgreSQL At Times After Server App Upgrade
- OS X Server 3.2.1 update breaks PostgreSQL
If you’ve used Server.app‘s own install then it may not preserve your databases when it upgrades. I can’t confirm the upgrade process it uses yet, and really need user tests reports for this.
Test reports and more information needed
Given these concerns, I would value reports and test results from OS X users who’re still on pre-Yosemite versions and planning to update soon.
If you’re an Apple customer, please also contact Apple support and ask them to investigate this.
So far I don’t know for sure if there’s data loss involved and I don’t have the access to investigate properly but I’m quite concerned about the preliminary indications I’m able to find.