Python Postgresql Connection Test