Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I updated some Cygwin packages and now I can't start Postgres:

$ /usr/sbin/postmaster
FATAL:  database files are incompatible with server
DETAIL:  The data directory was initialized by PostgreSQL version 8.2, which is not compatible with this version 9.2.4.

I tried pg_upgrade but you need to specify both the old and new binary. Plus, pg_upgrade says it only works with 8.3.

I thought I could use setup-x86.exe to pick the previous version, which is 8.2.11-1, however when I install that, then I can't start Postgres:

$ /usr/sbin/postgres.exe
Bad system call (core dumped)
share|improve this question
    
Hello my friend, we meet again. The data directory was initialized by PostgreSQL version 9.2, which is not compatible with this version 9.3.5. –  Chloe 15 mins ago

1 Answer 1

  1. Uninstall postgres 9
  2. Install postgres 8.2
  3. Install libpq
  4. /etc/rc.d/init.d/postgresql start
  5. Do this for each database:
    • pg_dump -f stocks.sql.gz -Z 9 -C stocks
  6. /etc/rc.d/init.d/postgresql stop
  7. cd $PGDATA/.. # /usr/share/postgresql/..
  8. mv postgresql postgresql-8.2
  9. Install postgres 9, postgresql-contrib, uninstall libpq.
  10. /usr/sbin/pg_ctl.exe init
  11. /usr/sbin/pg_ctl.exe start
  12. createdb.exe # Creates a DB with your username
  13. gzip -dc stocks.sql.gz | psql # many warnings + errors
share|improve this answer
1  
You left out one really important item -- Step Zero: Read the most excellent documentation. Your steps above are otherwise correct, though there shouldn't be "many warnings + errors" at step 13 -- the reload should go smoothly... –  voretaq7 Aug 20 '13 at 19:33
1  
You could also use pg_dumpall instead of dumping individual databases -- might make your life easier. –  voretaq7 Aug 20 '13 at 19:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.