lib/pq — pull request #143 by deafbybeheading (2013-09-14 00:03:36+00:00)
Title: Fix query error handling

This fixes the issues raised in #139 and passes tests on all four supported versions.

It changes the driver to return `(nil, error)` from Query and friends where possible, rather than returning a `sql.Rows` object that will later return an error. This feels more natural, but [the docs](http://godoc.org/database/sql) seem completely ambiguous on this and it could be a breaking change for some (e.g., anyone not checking the error from Query and proceeding directly to using the returned Rows object). That usage seems pretty bogus, though: there's no reason that Query would return an error if Rows could be used without inspecting it. So... I'm tempted to go ahead with this. Thoughts, @fdr, @kisielk (and anyone interested in #139)?