From hibernate 3.5 to 3.6 the annotation combination @Lob + byte does not on postgresql work due to idiosyncrasies in the postgresql JDBC driver.
To support this combination, the following dialect variant can be used along with a basic-type override, provided that the application consistently uses the same annotation style (@Lob + byte). A similar approach could be used to support using the OID blob type which postgresql provides, although this patch does not address it.
The user must register the basic type override MateralizedVarBinaryBlobType at boot time.
I am unsure exactly where in the distribution this would fit so I have kept it in one package (org.hibernate.dialect.variant).
I have test cases which I could detach from my current project, if the maintainers think this patch is worth including.