Error in executemany() if smallint followed by big

In executemany(), if the first parameter set has a smallint as a
particular parameter, and then if a subsequent parameter set has a
bigger int in the same parameter position, an error occurs. I've solved
this by sending ints in text format rather than binary format.