79620186

Date: 2025-05-13 17:56:44
Score: 0.5
Natty:
Report link

when postgresql server didn't shut down cleanly, it often leaves a stale postmaster.pid file behind — this file prevents postgresql from starting again

navigate to the postgresql data directory and delete the postmaster.pid file:

rm /opt/homebrew/var/postgresql@15/postmaster.pid

⚠️ replace 15 with your actual postgresql version.

if you're not sure which version you're using, you can find the correct path using tab completion:

cd /opt/homebrew/var/

then press Tab twice — it should show a directory like postgresql@14, postgresql@15, etc. and then go into that directory and delete the postmaster.pid:

rm /opt/homebrew/var/postgresql@<your_version>/postmaster.pid

restart the postgresql service:

brew services restart postgresql@<your_version>
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): when post
  • Low reputation (1):
Posted by: Sid