My PostgreSQL close unexpectedly the connection

March 10, 2019 393 views
PostgreSQL Server Optimization Ubuntu 18.04

Hello I've a PostgreSQL server which is presenting a problem that always says the server close the connection unexpectedly, how can I fix this? I am using flask
This is the error:

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.

1 Answer


To learn more about what is happening here, it may be important for you to review the logs for Postgres. You can read more information about logging and error reporting on Postgres here:


Have another answer? Share your knowledge.