4

I'm having trouble starting postgres as you can see below:

$ pg_ctl -D /usr/local/var/postgres start
server starting
FATAL:  database files are incompatible with server
DETAIL:  The data directory was initialized by PostgreSQL version 9.1, which is not compatible with this version 9.3.0.

Anyone know how to make the versions compatible?

2
  • The versions are not compatible. period. Upgrade from 9.1 to 9.2 or 9.3 requires a dump + restore. You'll have to have a running 9.1 installation to perform the dump. So you'll have to downgrade the binaries to 9.1 first. (this could be done by using two versions running-in-parallel, in different data directories, with different portnumbers, etc) Commented Sep 29, 2013 at 10:39
  • 1
    Please read this: postgresql.org/docs/current/static/upgrading.html Commented Sep 29, 2013 at 10:47

1 Answer 1

1

You have two choices:

  1. Run 9.1 version, dump your database and restore it using 9.3
  2. http://www.postgresql.org/docs/9.3/static/pgupgrade.html
Sign up to request clarification or add additional context in comments.

3 Comments

And how do you run a specific version (installed by homebrew)?
You can have multiple postgres running different version at once. They just need to point to different data directory and have different listen port. Another approach is to uninstall 9.1 before installing 9.3.
This does not answer how to do that. I found out somewhere, the answer is: $ brew switch postgresql <target.version.number>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.