A quick test on jOOQ 3.14.0-SNAPSHOT:
System.out.println(DSL.using(SQLDialect.POSTGRES).renderInlined(
DSL.field("test",
SQLDataType.INTEGER).div(3600).cast(SQLDataType.DOUBLE)
.div(24).cast(SQLDataType.INTEGER)
));
Yields:
cast((cast((test / 3600) as double precision) / 24) as int
On Tue, Oct 13, 2020 at 7:59 PM Thorsten Schöning <[email protected]>
wrote:
> Guten Tag Lukas Eder,
> am Montag, 12. Oktober 2020 um 08:58 schrieben Sie:
>
> > I'm assuming you're not using jOOQ 3.11 or older.
>
> But I am, 3.11.12, should have mentioned that of course. :-/ So thanks
> for testing and letting me know about the root cause and fix. I've ran
> into an unrelated problem when upgrading some months ago and need to
> fix that first at some point.
>
> > Field<Integer> daysCalc = secsCalc.div(3600).cast(SQLDataType.DECIMAL)
> > .div( 24).cast(SQLDataType.INTEGER);
>
> vs.
>
> > Field<Integer> daysCalc = secsCalc.div(3600).cast(SQLDataType.DOUBLE)
> > .div( 24).cast(SQLDataType.INTEGER);
>
> What I recognized as well: SQLDataType.DOUBLE doesn't work, because
> that renders to "double" in Postgres instead of "double precision" and
> the former doesn't exist in my Postgres 11.
>
> Might this be realted to the old jOOQ as well?
>
> Mit freundlichen Grüßen,
>
> Thorsten Schöning
>
> --
> Thorsten Schöning E-Mail: [email protected]
> AM-SoFT IT-Systeme http://www.AM-SoFT.de/
>
> Telefon...........05151- 9468- 55
> Fax...............05151- 9468- 88
> Mobil..............0178-8 9468- 04
>
> AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
> AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/138316955.20201013195915%40am-soft.de
> .
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jooq-user/CAB4ELO5cJh5pkBbQfxA99a0Yz5pE2SMT82E59enwA9wvsad_Ug%40mail.gmail.com.