brianc/node-postgres — pull request #158 by kongelaks (2012-07-24 17:29:23+00:00)
Title: Improve error message accuracy of native SendQuery

* add private method const char *GetLastError() to src/binding.cc
* add var const char *lastErrorMessage to SendQuery in src/binding.cc
* throw result of PQErrorMessage inside SendQuery

This commit replaces the static/vague error message "PQsendQuery
returned error code" with the actual message text of the error.
The method GetLastError() returns the text of PQErrorMessage.
GetLastError is called from within SendQuery to retrieve the message.