Support binding null UUID sql parameter with PostgreSQL

Description

It seems that if binding UUID to bind parameter everything goes ok as far as param value is not null. But when value is null Postgres will throw exception about unrecognized parameter type.

E.g. for error:

 

 

 

Postgres jdbc driver is fixed to work also in those cases:

But it works only if null is set by using:

PreparedStatement.setNull(pos, type, pgtype)

Currently it seems that PostgresUUIDType is implemented by returning overriden BasicBinder which uses

st.setNull( index, sqlDescriptor.getSqlType() );

for setting null.

So basically if null set is done like:

st.setNull( index, getSqlType(), "uuid" );

It would work.

Environment

None

Assignee

Unassigned

Reporter

Marko Kattelus

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure