pyPgSQL DatabaseError details

Reid Lai reidlai at reidlai.com
Sun Dec 29 11:22:29 EST 2002


Hi There,

I am newbie using Python and write a program which connects with my 
PostgreSQL 7.2.x database.  In this program, I use try ... except 
PySQL.DatabaseError ... statement to display error in shell level.  It 
works fine.  But now I am thinking to enhance error message and 
encountered a problem.

How can I extract information from DatabaseError exception to determine 
if database connection problem is due to availability of database 
service or incorrect user id and password?  Thanks for any help.

Regards,

Reid Lai




More information about the Python-list mailing list