Hello,
In the tutorial https://wiki.postgresql.org/wiki/Psycopg2_Tutorial,shouldn't at the end of the page add a section to call conn.close()?
Reference in http://initd.org/psycopg/docs/connection.html, to ensurethe connection is closed.
Alvin