New answers tagged


PostgreSQL doesn't drop idle connections. It must be something else, probably a misconfigured firewall. To defend against that, set the parameter tcp_keepalives_idle on the server to something less than the default 2 hours. There is also a corresponding parameter keepalives_idle on the client side that you could set when you connect with psycopg2. Both ...

Top 50 recent answers are included