Last active
June 19, 2025 14:34
-
-
Save cjolly/2870054 to your computer and use it in GitHub Desktop.
Revisions
-
cjolly revised this gist
Dec 9, 2016 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,11 @@ newpg=9.6.1 # set to new PG version number oldpg=`pg_config --version | cut -d' ' -f2` # PG 96. upgrades the readline to v7, which breaks anything linked against readline v6, like ruby via ruby-build. # I *think* this should prevent it from installing v7. But if weird shit happens with various rubies, # you'll have to reinstall them. brew pin readline # Stop current Postgres server brew services stop postgresql -
cjolly revised this gist
Dec 7, 2016 . 1 changed file with 1 addition and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ newpg=9.6.1 # set to new PG version number oldpg=`pg_config --version | cut -d' ' -f2` # Stop current Postgres server @@ -10,10 +11,6 @@ mv /usr/local/var/postgres/ /usr/local/var/postgres-$oldpg brew update brew upgrade postgresql # Create new DB initdb /usr/local/var/postgres -E utf8 -
cjolly revised this gist
Dec 7, 2016 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,6 @@ brew upgrade postgresql # newpg=9.6.1 newpg=`brew list --versions postgresql | sort | tail -1 | cut -d' ' -f2` # Create new DB initdb /usr/local/var/postgres -E utf8 -
cjolly revised this gist
Dec 7, 2016 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -39,7 +39,5 @@ brew services start postgresql ./delete_old_cluster.sh brew cleanup postgresql # Go home cd ~ -
cjolly revised this gist
Dec 7, 2016 . 1 changed file with 10 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,4 @@ oldpg=`pg_config --version | cut -d' ' -f2` # Stop current Postgres server brew services stop postgresql @@ -11,6 +10,11 @@ mv /usr/local/var/postgres/ /usr/local/var/postgres-$oldpg brew update brew upgrade postgresql # set below to new version number "9.6.1", or use cmd to below # newpg=9.6.1 newpg=`brew list --versions postgresql | sort | tail -1 | cut -d' ' -f2` # Create new DB initdb /usr/local/var/postgres -E utf8 @@ -30,8 +34,12 @@ brew services start postgresql # Clean new DB ./analyze_new_cluster.sh # Make sure all your shit works! # After determining upgrade successful you can remove old DB. ./delete_old_cluster.sh brew cleanup postgresql # Go home cd ~ -
cjolly revised this gist
Dec 7, 2016 . 1 changed file with 12 additions and 18 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,37 +1,31 @@ newpg=9.6.1 oldpg=9.3.2 # set this to your current PG version # Stop current Postgres server brew services stop postgresql # Backup current db mv /usr/local/var/postgres/ /usr/local/var/postgres-$oldpg # Homebrew brew update brew upgrade postgresql # Create new DB initdb /usr/local/var/postgres -E utf8 # Upgrade old DB to new DB mkdir -p /tmp/pgupgrade && cd $_ pg_upgrade \ --old-datadir=/usr/local/var/postgres-$oldpg/ \ --new-datadir=/usr/local/var/postgres \ --old-bindir=/usr/local/Cellar/postgresql/$oldpg/bin \ --new-bindir=/usr/local/Cellar/postgresql/$newpg/bin \ --jobs=4 # Start new Postgres server # launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist brew services start postgresql # Clean new DB ./analyze_new_cluster.sh -
cjolly revised this gist
Jan 8, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,9 +7,12 @@ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist # Backup current db mv /usr/local/var/postgres/ /usr/local/var/postgres-$oldpg # Homebrew # Check here if you have issues with either of these https://github.com/Homebrew/homebrew/wiki#troubleshooting brew update brew upgrade postgresql # OS X launch agents for PG, so it starts on boot automatically cp /usr/local/Cellar/postgresql/$newpg/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/ # These settings may or may not be necessary, investigate on your own -
cjolly revised this gist
Jan 8, 2014 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,10 @@ initdb /usr/local/var/postgres # Upgrade old DB to new DB mkdir -p /tmp/pgupgrade && cd $_ pg_upgrade -d /usr/local/var/postgres-$oldpg/ \ -D /usr/local/var/postgres \ -b /usr/local/Cellar/postgresql/$oldpg/bin \ -B /usr/local/Cellar/postgresql/$newpg/bin # Start new Postgres server launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist -
cjolly revised this gist
Jan 8, 2014 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ newpg=9.3.2 oldpg=9.2.4 # set this to your current PG version @@ -22,14 +21,17 @@ sudo sysctl -w kern.sysv.shmmax=16777216 initdb /usr/local/var/postgres # Upgrade old DB to new DB mkdir -p /tmp/pgupgrade && cd $_ pg_upgrade -d /usr/local/var/postgres-$oldpg/ -D /usr/local/var/postgres -b /usr/local/Cellar/postgresql/$oldpg/bin -B /usr/local/Cellar/postgresql/$newpg/bin # Start new Postgres server launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist # Clean new DB ./analyze_new_cluster.sh # After determining upgrade successful you can remove old DB. ./delete_old_cluster.sh # Go home cd ~ -
cjolly revised this gist
Jan 8, 2014 . 1 changed file with 22 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,35 @@ newpg=9.3.2 oldpg=9.2.4 # set this to your current PG version # Stop current Postgres server launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist # Backup current db mv /usr/local/var/postgres/ /usr/local/var/postgres-$oldpg brew update brew upgrade postgresql cp /usr/local/Cellar/postgresql/$newpg/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/ # These settings may or may not be necessary, investigate on your own # http://www.postgresql.org/docs/9.3/static/kernel-resources.html sudo sysctl -w kern.sysv.shmall=65536 sudo sysctl -w kern.sysv.shmmax=16777216 # Create new DB initdb /usr/local/var/postgres # Upgrade old DB to new DB pg_upgrade -d /usr/local/var/postgres-$oldpg/ -D /usr/local/var/postgres -b /usr/local/Cellar/postgresql/$oldpg/bin -B /usr/local/Cellar/postgresql/$newpg/bin # Start new Postgres server launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist # Clean new DB (probably not necessary) vacuumdb --all # After determining upgrade successful you can remove old DB. rm -rf /usr/local/var/postgres-$oldpg -
cjolly created this gist
Jun 4, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ pg_ctl -D /usr/local/var/postgres stop -s -m fast launchctl unload -w ~/Library/LaunchAgents/org.postgresql.postgres.plist rm ~/Library/LaunchAgents/org.postgresql.postgres.plist mv /usr/local/var/postgres/ /usr/local/var/postgres-9.0.4/ brew update brew upgrade postgresql cp /usr/local/Cellar/postgresql/9.1.3/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/ sudo sysctl -w kern.sysv.shmall=65536 sudo sysctl -w kern.sysv.shmmax=16777216 initdb /usr/local/var/postgres pg_upgrade -d /usr/local/var/postgres-9.0.4/ -D /usr/local/var/postgres -b /usr/local/Cellar/postgresql/9.0.4/bin -B /usr/local/Cellar/postgresql/9.1.3/bin launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist vacuumdb --all --analyze-only