Hello,

>> ERROR: column "created_ip" is of type inet but expression is of type
character varying

> >>  Hint: You will need to rewrite or cast the expression.
>
> Is there a way to solve this issues?
>

The easiest workaround is to write this:

factory.insertInto(REGISTRATION)
.set(REGISTRATION.EMAIL, "[email protected]")
.set(REGISTRATION.PASSWORD_HASH, "2304820984309238409237428739")
.set(REGISTRATION.CREATED_IP, field("?::inet", String.class, "::1"))
.execute();

By using plain SQL, you can cast bind values to custom data types

Should type INET be supported by jooq natively?
>

It probably should, I have created #2092 for this:
https://github.com/jOOQ/jOOQ/issues/2092

So far, I'm not quite sure how to handle these dialect-specific data types,
that are not really compatible with any of java.sql.Types' types.
Specifically, Postgres and the Postgres JDBC driver have their ways of
dealing with these non-standard situations.

Any implementation hint for #2092 is very welcome

Cheers
Lukas

Reply via email to