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 :
- Following this answer I made sure that both
pg_hba.conf
andpostgresql.conf
files configured correctly (addedlisten_addresses = '*'
topostgresql.conf
and made sure that I accept any IPhost all all 0.0.0.0/0 trust
inpg_hba.conf
. - Following this answer I've downgraded my Postgres version from 12 to 10 and it did not work either.
- Removed EVERYTHING related to Postgres and reinstalled using Homebrew using this guide
- 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).