0

I encountered a weird issue with my Postgres, suddenly (after YEARS) I can't connect to it using my Golang application code or via psql but the funny thing is that my DBeaver application can!

This is what I try and the error I get:

psql -U postgres -h localhost                                                                                               
psql: server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.

I did some research and tried a bunch of stuff which seems to resolve this issue for other users :

  1. Following this answer I made sure that both pg_hba.conf and postgresql.conf files configured correctly (added listen_addresses = '*' to postgresql.conf and made sure that I accept any IP host all all 0.0.0.0/0 trust in pg_hba.conf.
  2. Following this answer I've downgraded my Postgres version from 12 to 10 and it did not work either.
  3. Removed EVERYTHING related to Postgres and reinstalled using Homebrew using this guide
  4. Removed the Homebrew installation and tried to use the PostgresApp for Mac - no luck either.

I'm stuck! Does anyone know what could go wrong? I have no idea what went wrong to cause this issue. I'm working on OSX Catalina 10.15.4 if it helps.

Any help will be highly appreciated!

Update:

Step 2 works great, the issue was with the latest update of my anti-virus (ESET).

Soil92
  • 37
  • 2
  • 9
  • What do you see in the database logs when you try to connect? – Thom Brown May 12 '20 at 08:00
  • Using step #2 I've investigated the server log and saw that the server is accepting connections on ```127.0.0.1``` and using this it worked, this is so weird. I used to work using ```localhost``` all the time. Thanks anyway! – Soil92 May 12 '20 at 08:14
  • Found out that the actual issue was with the latest update of my anti-virus (ESET), disabling the Firewall resolved the issue. – Soil92 May 12 '20 at 09:42

0 Answers0