PGInterval is not supported in dialect POSTGRES

22 views
Skip to first unread message

eyp.g...@gmail.com

unread,
Nov 13, 2016, 12:23:53 PM11/13/16
to jOOQ User Group
I try to query by a given Interval:

dsl.select(ABC.DEF).from(ABC).where(ABC.INTERVAL.eq(pgInterval)).fetch();

But I get the warning: Not supported by dialect : Type class org.postgresql.util.PGInterval is not supported in dialect POSTGRES

And the Exception:

org.jooq.exception.SQLDialectNotSupportedException: Type class org.postgresql.util.PGInterval is not supported in dialect POSTGRES

What can I do?

Lukas Eder

unread,
Nov 13, 2016, 12:54:24 PM11/13/16
to jooq...@googlegroups.com
Hello,

Unfortunately, PostgreSQL's INTERVAL data types are currently not yet fully supported as standalone data types, only as arguments to date time arithmetic functions. This is part of the following feature request:

As a workaround, you could easily implement your own data type binding as documented here:

Hope this helps,
Lukas

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

eyp.g...@gmail.com

unread,
Nov 13, 2016, 2:44:27 PM11/13/16
to jOOQ User Group, eyp.g...@gmail.com
Thank you for your reply.

An additional workaround is (if possible) always to use native sql, which works fine in combination with jooq.

Lukas Eder

unread,
Nov 13, 2016, 3:56:01 PM11/13/16
to jooq...@googlegroups.com
Yes, of course - plain SQL is always an option.

2016-11-13 20:44 GMT+01:00 <eyp.g...@gmail.com>:
Thank you for your reply.

An additional workaround is (if possible) always to use native sql, which works fine in combination with jooq.

--
Reply all
Reply to author
Forward
0 new messages