If the query produces an error, log the query which produced the error in addition to the insert statement which preceded it. This helped me track down an issue with a mis-named sequence from a bad MySQL->PostgreSQL migration. Signed-off-by: Kevin Locke <kevin@kevinlocke.name>