Reputation: 495
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 '.
Upvotes: 3
Views: 4136
Reputation: 2572
In my case, I had chosen to create an Azure SQL Database rather than an Azure Database for PostgreSQL. I doubt many others have made this mistake, but if you have, it will cause this error!
Upvotes: -1
Reputation: 3179
You need to add your IP address or VNet in Connection Security. By default it is blocked.
Upvotes: 1
Reputation: 388
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
Upvotes: 1