# When Postgres Won't Start

DevFeed: [When Postgres Won't Start](<https://devfeed.tech/articles/when-postgres-won-t-start-28222.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/postgres/2020/09/12/when-postgres-won-t-start.html>)

Author: Fuzzygroup

Published: 2020-09-12T11:05:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [upgrade](<https://devfeed.tech/topics/upgrade.md>), [postgresql clusters](<https://devfeed.tech/topics/postgresql-clusters.md>)

Tags: [install](<https://devfeed.tech/tags/install.md>), [logs](<https://devfeed.tech/tags/logs.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [server](<https://devfeed.tech/tags/server.md>), [sysadmin](<https://devfeed.tech/tags/sysadmin.md>), [upgrade](<https://devfeed.tech/tags/upgrade.md>)

## AI overview

A PostgreSQL installation was upgraded from version 11 to 12.4 without upgrading its data directory, preventing the database server from starting. The article explains how to diagnose the incompatibility through PostgreSQL logs and lists commands used to resolve it.

## Source excerpt

TLDR Somehow my postgres installation was upgraded. When postgres is upgraded its data is NOT upgraded. This means postgres won't start BUT it will be a silent failure; you can only confirm this via the logs. tail -n 10 /usr/local/var/log/postgres.log The Long Version I went through a situation the other day where I would start and stop postgres and the database would NEVER be available for connection. Here is the error that I kept getting: ❯ psql psql: error: could not connect to server: 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"? This blog posts lists all the commands I used for reference and how I fixed it: brew services restart postgres brew services stop postgres brew services start postgres rm -f /usr/local/var/postgres/postmaster.pid brew uninstall postgresql brew install postgresql brew reinstall postgresql brew upgrade postgres ls -l /usr/local/var/postgres/postmaster.pid ls -l /usr/local/var/postgres/ tail -n 10 /usr/local/var/log/postgres.log brew postgresql-upgrade-database tail -n 10 /usr/local/var/log/postgres.log As is always the case with this type of low level issue, the answer is ALWAYS IN THE DAMN LOGS and it is always the near to last command you use that finds it. Here's what I found: ❯ tail -n 10 /usr/local/var/log/postgres.log 2020-09-10 16:17:49.566 EDT [85169] FATAL: database files are incompatible with server 2020-09-10 16:17:49.566 EDT [85169] DETAIL: The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 12.4. 2020-09-10 16:17:59.589 EDT [85170] FATAL: database files are incompatible with server 2020-09-10 16:17:59.589 EDT [85170] DETAIL: The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 12.4. 2020-09-10 16:18:09.617 EDT [85172] FATAL: database files are incompatible with server 2020-09-10 16:18:09.617 EDT [85172] DETAIL: The data