Postgres error — “/tmp/.s.PGSQL.5432”? — FIX

Thomas Large
Apr 12, 2019 · 1 min read

Have you come across this error before? Postgres is running but you are unable to connect? Well here is the fix!

The issues happens when the Postgres services are stopped in a forceful way, for example, if your mac was to turn off or you have a power cut.

I have this installed with Brew so this is how I fixed the issue,

  1. First, see if Postgres is running
brew services list

2. If it is running stop it, with the below. This is important as if you don’t stop the services when you get to step 3 this will corrupt your database.

brew services stop postgresql

3. Now, this has stopped you need to remove the file. This is located here


4. When you have removed this start the service again and you will be able to connect again

brew services start postgresql

If anyone has any issues with this please let me know!

Thomas Large

Written by

I am a Developer, Working with React, React Native and Node. All posts are how to’s not just for me but the development community!

More From Medium

Related reads

Related reads

Also tagged Postgresql

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade