SubDialect of PostgreSQLDialect to support (@Lob + byte[]) combination

Description

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.

Environment

3.6.0.CR1, postgresql

Status

Assignee

Unassigned

Reporter

Justin Sands

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major