From edcd307b04b6fd00d282ab24c7ec3e2a556ebd12 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Fri, 10 Feb 2012 19:22:54 +0000 Subject: [PATCH] [#1125] Postgres needs casting for date time data types in queries like SELECT ? FROM DUAL --- jOOQ/src/main/java/org/jooq/impl/Val.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/Val.java b/jOOQ/src/main/java/org/jooq/impl/Val.java index 06446689eb..6290fc3d42 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Val.java +++ b/jOOQ/src/main/java/org/jooq/impl/Val.java @@ -170,8 +170,9 @@ class Val extends AbstractField implements Param, BindingProvider { // [#1029] Postgres generally doesn't need the casting. Only in the // above case where the type is OTHER - // [#1125] TODO Also with temporal data types, casting is needed some times - else if (context.getDialect() == POSTGRES /* && !type.isTemporal() */) { + // [#1125] Also with temporal data types, casting is needed some times + // [#1130] TODO type can be null for ARRAY types, etc. + else if (context.getDialect() == POSTGRES && (type == null || !type.isTemporal())) { toSQL(context, getValue(), getType()); }