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?

locoboy
  • 38,002
  • 70
  • 184
  • 260
  • 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) – wildplasser Sep 29 '13 at 10:39
  • 1
    Please read this: http://www.postgresql.org/docs/current/static/upgrading.html –  Sep 29 '13 at 10:47

1 Answers1

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
Tomasz Myrta
  • 1,114
  • 8
  • 10
  • And how do you run a specific version (installed by homebrew)? – Arta Mar 05 '14 at 20:37
  • 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. – Tomasz Myrta Mar 07 '14 at 12:00
  • 4
    This does not answer how to do that. I found out somewhere, the answer is: $ brew switch postgresql – Arta Mar 07 '14 at 15:23