Postgres - FATAL: database files are incompatible with server

后端 未结 7 1988
半阙折子戏
半阙折子戏 2020-12-07 07:20

After restarting my MacBook Pro I am unable to start the database server:

could not connect to server: No such file or directory
Is the server running local         


        
7条回答
  •  孤街浪徒
    2020-12-07 08:01

    If you want to keep the previous version of postgres, use brew switch:

    $ brew info postgresql
    
    postgresql: stable 10.5 (bottled), HEAD
    Object-relational database system
    https://www.postgresql.org/
    Conflicts with:
      postgres-xc (because postgresql and postgres-xc install the same binaries.)
    /usr/local/Cellar/postgresql/9.6.3 (3,259 files, 36.6MB)
      Poured from bottle on 2017-07-09 at 22:15:41
    /usr/local/Cellar/postgresql/10.5 (1,705 files, 20.8MB) *
      Poured from bottle on 2018-11-04 at 15:13:13
    
    $ brew switch postgresql 9.6.3
    $ brew services stop postgresql
    $ brew services start postgresql
    

    Otherwise, consider this brew command to migrate existing data: brew postgresql-upgrade-database. Check out the source code.

提交回复
热议问题