Skip to content

Instantly share code, notes, and snippets.

@rubyandcoffee
Created February 18, 2020 21:19
Show Gist options
  • Save rubyandcoffee/681b84268d44206e594bb7dde14b94e3 to your computer and use it in GitHub Desktop.
Save rubyandcoffee/681b84268d44206e594bb7dde14b94e3 to your computer and use it in GitHub Desktop.
Various issues with PostgreSQL
Run `postgres -D /usr/local/var/postgres` to diagnose issue
If it returns error:
```
FATAL: database files are incompatible with server
DETAIL: The data directory was initialized by PostgreSQL version 9.2, which is not compatible with this version 9.0.4.
```
Then run `brew postgresql-upgrade-database`
Run `postgres -D /usr/local/var/postgres` again.
If it returns the following:
```
FATAL: lock file "postmaster.pid" already exists
HINT: Is another postmaster (PID 67646) running in data directory "/usr/local/var/postgres"?
```
Then run: `rm /usr/local/var/postgres/postmaster.pid`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment