If you run Homebrew on your OSX and you use that to install postgres you will have noted there's a new formula for Postgres 9.3(.4). Yay! (actually this was done many months ago but I'm slow to keep my brews upgraded)

When you run the upgrade you'll notice that psql no longer works because the server can't start.

Bummer! But there's hope: This excellent blog post

That's all you need. ...unless you have some uncompatible library extension installed. E.g. json_enhancements

The problem is that you can't install json_enhancements into a Postgres 9.3 server (json_enhancements is a backport from 9.3 to desperate people still on 9.2). And you can't do the upgrade because the new server has one less installed library. You'll get this after a failing pg_upgrade:

peterbe@mbp:~$ cat loadable_libraries.txt
Could not load library "$libdir/json_enhancements"
ERROR:  could not access file "$libdir/json_enhancements": No such file or directory

I left some more details about this on the pgsql-admin mailing list.

The trick that worked for me was to start the old 9.2 server like this:

/usr/local/Cellar/postgresql/9.2.2/bin/postgres -D /usr/local/var/postgres -p 9000

And now I can open psql against the old data[base] and drop the extension:

$ psql -p 9000 mydatabase
psql (9.3.4, server 9.2.2)
mydatabase=# drop extension json_enhancements;

After I had done that I was able to successfully complete the pg_upgrade.

I hope this helps some other poor sucker stuck in the same chicken and egg situation.

UPDATE

A much better blog post to guide you is Ketia's Blog. For example, here's a post about upgrading from 9.4 to 9.5.

Comments

Your email will never ever be published.

Previous:
Do you like angular-classy? April 29, 2014 AngularJS, JavaScript
Next:
HTML Tree on Hacker News May 18, 2014 Web development, JavaScript
Related by category:
Inspecting the index size in PostgreSQL April 21, 2025 PostgreSQL
The 3 queries I use with pg_stat_statements to analyze slow PostgreSQL queries September 30, 2024 PostgreSQL
Select all relations in PostgreSQL December 10, 2015 PostgreSQL
How much faster is Redis at storing a blob of JSON compared to PostgreSQL? September 28, 2019 PostgreSQL
Related by keyword:
Msgpack vs JSON (with gzip) December 19, 2017 Python, Web development
How slow is Node to Brotli decompress a file compared to not having to decompress? January 19, 2024 Linux, Node, macOS
Cope with JSONDecodeError in requests.get().json() in Python 2 and 3 November 16, 2016 Python
From Postgres to JSON strings November 12, 2013 Python