Fixed the parameters to the call to pgdb.connect which were totally wrong.