fix issues with bytea columns

... bytea columns.

Based on the POC patch from ioguix.
This fixes SF Bug # 3243916.