encode bytea values through the special functions for postgresql in INSERT statements and WHERE clauses, to fix binary values not inserting correctly.  add test coverage.