fix error handling after query
Merge pull request #24 from easeway/pg-9.0-workaround

fix error handling after query