lpsmith / postgresql-simple

Mid-level client library for accessing PostgreSQL from Haskell
Other
206 stars 71 forks source link

Query resulted in a command response #272

Closed linearray closed 5 years ago

linearray commented 5 years ago

About once a year I hit the error mentioned above and frantically try to fix it. Googling it is of no use, because the only results are from pg-simple's source code, where I can see that status is PQ.CommandOk, which does not present me with any obvious clues to the source of the problem.

After I inch closer to my inevitable demise for an hour or so it hits me that I used query instead of execute, or even more likely I forgot something like RETURNING id in a query.

Would you accept a patch that changes the error message to something like "Query resulted in a command response (did you mean to use execute?)"

phadej commented 5 years ago

I'm not sure what you are talking about, but yes.

/Note/ currently I maintain the postgresql-simple at https://github.com/phadej/postgresql-simple

jonoabroad commented 5 years ago

This was helpful.