The data directory contains an old postmaster.pid file
PostgreSQL Connection Failure
I experienced this issue when my laptop crushed and after rebooting, PostgreSQL was unable to connect to the database. I attempted to start my server and this error dialog window appeared.
The Problem: Two instances of the same PostgreSQL server cannot run on the same data directory at the same time thanks to the postmaster.pid lock file. Follow the link for more information about what a postmaster.pid file is, otherwise let's move on to resolving our issues.
STEP 1:
Click on the “OK” button to close the dialog window or open the Postgres.app desktop app if its not already open
STEP 2
Click on “Server Settings…” button
Click on Show button next to the Data Directory. This should open the data directory of your PostgreSQl installation.
STEP 3
Once you have located your postmaster.pid file. Delete it!
STEP 4
After deleting the file, the error message should change from "Stale postmaster.pid file" to "Not running" on the Postgres GUI app . Now just start your PostgreSQL server by clicking the "Start" button on the Postgres GUI app
Finally













