简体   繁体   中英

Postgres database missing after rails crash

My rails app crashed and when I attempted to restart the server and connect I kept seeing:

$ psql
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 following the instructions in many different questions, reinstalling postgres, updating brew, etc. and nothing was working. The only file I removed was the postmaster.pid file from /usr/local/var/postgres . When I looked in the server.log file I saw I was using the wrong version of postgres and that the data directory was for another version.

I installed the older version and when I run psql it cannot find my database. The only available databases are postgres , template0 , and template1

Am I missing something or did I manage to delete all my data?

If, when you reinstalled Postgres, you made a major database version change, your database will be gone. Perhaps this will help you migrate your old data to your new running postgres instance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM