"ERROR: column``foo""is of type bytea but expression is of type oid."
There seems to be a solution, still it includes patching of Hibernate library (something I see as the last option when playing with 3. rd party library).