Postgresql Exception Handling In Python Definition Function Of Three