Search code examples
postgresqlazurepsqlpgadmin-4azure-postgresql

azure + postgresql: How to fix error: Unable to connect to server: server closed the connection unexpectedly


i use postgresql server in azure. Until few hours ago I was able to access the server from pgAdmin 4 but now I get the following error:

' Unable to connect to server: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. '

Same for using psql.

From my node js backend app I can access the database to get and edit the db.

How can I fix the access for the db server from pgAdmin 4 and psql?

EDIT: I managed to connect from psql but still not from pgAdmin 4, and after enabling disconnection logs in azure I get this log: ' An existing connection was forcibly closed by the remote host '.


Solution

  • https://stackoverflow.com/a/59640480/798053 fixed it for me:

    $ brew services stop postgresql
    $ brew install postgresql@10
    $ brew services start postgresql@10
    $ brew link --overwrite --force postgresql@10ode here