views:

24

answers:

2

Hi

When connected to a postgresql database using psycopg and I pull the network cable I get no errors. How can I detect this in code to notify the user?

A: 

You will definitely get an error the next time you try and execute a query, so I wouldn't worry if you can't alert the user at the exact instance they lose there network connection.

mikerobi
Except I am not getting any errors. The code simply hangs on fetchall() and never raises an error.
Rob