Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PostgreSQL 9.2 upgrade steps
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. brew update
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
8. pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
If you're using ruby, also:
gem pristine pg
@tommeier

This comment has been minimized.

Copy link

tommeier commented Sep 20, 2012

also (delete old migrated postgres folder with great prejudice)

  1. rm -rf /usr/local/var/postgres91
@pacoguzman

This comment has been minimized.

Copy link

pacoguzman commented Sep 22, 2012

Thanks!

@mattbeedle

This comment has been minimized.

Copy link

mattbeedle commented Oct 2, 2012

Thanks!

@ojiry

This comment has been minimized.

Copy link

ojiry commented Oct 11, 2012

Thanks!

@liangzan

This comment has been minimized.

Copy link

liangzan commented Oct 11, 2012

thanks!

@58bits

This comment has been minimized.

Copy link

58bits commented Jan 25, 2013

Another big thanks..!

@rkenzhebekov

This comment has been minimized.

Copy link

rkenzhebekov commented Feb 1, 2013

Thanks!

@sstuddard

This comment has been minimized.

Copy link

sstuddard commented Jul 25, 2013

Huge thanks!

@ghost

This comment has been minimized.

Copy link

ghost commented Sep 14, 2013

This saved me so much time. 👍 x 💯

@barnett

This comment has been minimized.

Copy link

barnett commented Nov 6, 2013

+1 after looking for a night finally found the answer, thank you!

@Hettomei

This comment has been minimized.

Copy link

Hettomei commented Dec 1, 2013

I understand nothing but it works perfectly from 9.2.4 to 9.3.1. thanks a lot.

@muscardinus

This comment has been minimized.

Copy link

muscardinus commented Dec 15, 2013

Thanks a lot. This worked for me when upgrading from 9.2.4 to 9.3.2.

@mfpiccolo

This comment has been minimized.

Copy link

mfpiccolo commented Jul 15, 2014

👍

@brentcappello

This comment has been minimized.

Copy link

brentcappello commented Jul 22, 2014

After recently upgrading to OSX 10.9.4 my Postgres connection failed. I began to receive an error complaining about accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432". I had two versions of Postgres installed 9.2.1 and 9.3.4. After a day of trial and error I followed the above steps replacing with my versions and bingo, success. Thanks for the help!

@strongriley

This comment has been minimized.

Copy link

strongriley commented Dec 5, 2014

You may have to create some directories as well. I ran into this issue, but Stack overflow to the rescue!

@alexanderfrankel

This comment has been minimized.

Copy link

alexanderfrankel commented Dec 24, 2014

FINALLY! Thank you!

@ManuelThurner

This comment has been minimized.

Copy link

ManuelThurner commented Feb 2, 2015

Thanks, great help

@ambethia

This comment has been minimized.

Copy link

ambethia commented Apr 25, 2015

Saved the day, thanks!

@sunil-shrestha

This comment has been minimized.

Copy link

sunil-shrestha commented May 3, 2015

Awesome. Thanks !

@traviskaufman

This comment has been minimized.

Copy link

traviskaufman commented May 30, 2015

You sir are a boss. Thanks so much for this!

@krisdigital

This comment has been minimized.

Copy link

krisdigital commented Nov 17, 2015

Thanks!

@AntonTrapp

This comment has been minimized.

Copy link

AntonTrapp commented May 13, 2016

Thanks! Just updated 9.4 to 9.5.2 without any problems, just had to change the version numbers :)

@Xosmond

This comment has been minimized.

Copy link

Xosmond commented Jun 10, 2016

Great, works to upgrade from 9.4.5 to 9.5.3

@mgidea

This comment has been minimized.

Copy link

mgidea commented Dec 2, 2016

Thanks! worked great upgrading from 9.4.1 to 9.6.1

@delef

This comment has been minimized.

Copy link

delef commented Dec 6, 2016

Thanks, works to upgrade from 9.5.3 to 9.6.1

@jaybowles

This comment has been minimized.

Copy link

jaybowles commented Feb 3, 2017

Worked 1st time, thanks! 9.5.4 to 9.6.1.

@mostlydev

This comment has been minimized.

Copy link

mostlydev commented Feb 4, 2017

👍 Me too. This is getting repetitive, but the repetitive thanks are well earned.

@haukelicht

This comment has been minimized.

Copy link

haukelicht commented Apr 12, 2017

Worked for 9.5.3 to 9.6.2 - Thanks!

@crogersdev

This comment has been minimized.

Copy link

crogersdev commented Dec 26, 2017

👍

Going from 9.6 to 10.1 on macOS (10.13.1) I had to specify the new local cluster storage for the pg_upgrade call on step 6. To wit:

$ pg_upgrade -b /usr/local/Cellar/postgresql/9.6.3/bin -B /usr/local/Cellar/postgresql/10.1/bin -d /usr/local/var/postgres96 -D /usr/local/var/postgres

@morriskimani

This comment has been minimized.

Copy link

morriskimani commented Jan 13, 2018

Thank you for this. Saved me a lot of time.

@emil-alexandrescu

This comment has been minimized.

Copy link

emil-alexandrescu commented Jan 22, 2018

Thanks! Worked like charm when I upgrade from 9.6.5 to 10.1.

@JocelynTriplett

This comment has been minimized.

Copy link

JocelynTriplett commented Feb 28, 2018

Thanks so much for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.