From 2b06039e505134f79ef770043e87b436394082ae Mon Sep 17 00:00:00 2001 From: lukaseder Date: Tue, 17 Feb 2015 10:49:14 +0100 Subject: [PATCH] [#4065] Exception when loading array results from plain SQL queries into a Record --- .../main/java/org/jooq/impl/DefaultDataType.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java b/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java index 14f3ff5cf3..67e847e30a 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java +++ b/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java @@ -643,15 +643,17 @@ public class DefaultDataType implements DataType { } // UDT data types and others are registered using DEFAULT - if (result == null) { + if (result == null) result = TYPES_BY_NAME[SQLDialect.DEFAULT.ordinal()].get(typeName); - } - if (result == null) { - // [#366] Don't log a warning here. The warning is logged when - // catching the exception in jOOQ-codegen + // [#4065] PostgreSQL reports array types as _typename, e.g. _varchar + if (result == null && dialect.family() == SQLDialect.POSTGRES && typeName.charAt(0) == '_') + result = getDataType(dialect, typeName.substring(1)).getArrayDataType(); + + // [#366] Don't log a warning here. The warning is logged when + // catching the exception in jOOQ-codegen + if (result == null) throw new SQLDialectNotSupportedException("Type " + typeName + " is not supported in dialect " + dialect, false); - } return result; }