This repository has been archived by the owner. It is now read-only.

Postgres won't start after upgrading to 9.2 on lion #15045

Closed
sweded opened this Issue Sep 22, 2012 · 8 comments

Comments

Projects
None yet
7 participants
@sweded

sweded commented Sep 22, 2012

Today I ran brew update followed by brew upgrade which brought my postgres installation from 9.1.4 to 9.2. Postgres no longer starts.

psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

I followed all the steps listed in brew info postgres including deleting the previous plist and copying the one for 9.2. The launchctl command informs me its already loaded. Tried starting postgres manually. Many reboots occurred along the way. The path looks correct /usr/local/bin/postgres and the version is postgres (PostgreSQL) 9.2.0 indicating the formula built correctly.

@mxcl

This comment has been minimized.

Member

mxcl commented Sep 22, 2012

which -a psql

@MikeMcQuaid

This comment has been minimized.

Member

MikeMcQuaid commented Sep 22, 2012

@Sharpie

This comment has been minimized.

Contributor

Sharpie commented Sep 22, 2012

I followed all the steps listed in brew info postgres including deleting the previous plist and copying the one for 9.2.

Did you also upgrade the database? Moving between major versions, such as going from 9.1.4 to 9.2.0, requires a database dump and reload and the server won't boot unless this is done.

@cehoffman

This comment has been minimized.

Contributor

cehoffman commented Sep 24, 2012

If you tail /usr/local/bin/postgres/server.log you'll most likely see postgres complaining of version incompatability with the database. Like @Sharpie said, you'll need to follow the directions at http://www.posgresql.org/docs/9.2/static/upgrading.html to get 9.2 working.

Basically:

launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
/usr/local/Cellar/postgresql/9.1.4/bin/pg_ctrl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
/usr/local/Cellar/postgresql/9.1.4/bin/pg_dumpall > backup
/usr/local/Cellar/postgresq/9.1.4/bin/pg_ctrl -D /usr/local/var/postgres stop -s -m fast
mv /usr/local/var/postgres{,.9.1.4}
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
psql -d postgres -f backup

Unfortunately, if you have already run a brew cleanup and removed the previous postgres you may be in a bit of bind unless you know how to temporarily revert the homebrew postgres formula to 9.1.4 for a reinstall.

@mxcl

This comment has been minimized.

Member

mxcl commented Sep 24, 2012

Unfortunately, if you have already run a brew cleanup and removed the previous postgres you may be in a bit of bind unless you know how to temporarily revert the homebrew postgres formula to 9.1.4 for a reinstall.

brew versions postgresql

@gmile

This comment has been minimized.

gmile commented Sep 24, 2012

@sweded This is more likely to be the common pg shared buffers problem, which might have been overriden (?) after pg update. See Mac OS section of http://www.postgresql.org/docs/9.2/static/kernel-resources.html

@cehoffman

This comment has been minimized.

Contributor

cehoffman commented Sep 24, 2012

Good to know on the versions thing. It has been many months since I had to actually update anything related to homebrew so I was unaware of that addition.

@gmile Good to point out another possible issue, but having just upgraded to 9.2 from 9.1.4 myself it was exactly a database version mismatch which caused 9.2 to not start for me.

@adamv

This comment has been minimized.

Contributor

adamv commented Sep 30, 2012

Closing due to no response from the original poster, but presumably the links and steps given in this conversation will fix the issue.

@adamv adamv closed this Sep 30, 2012

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.