diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java | 8 | ||||
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java index 8949eabc75b..eecce9c939c 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java @@ -862,7 +862,13 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu case Types.VARBINARY: return getBytes(columnIndex); default: - return connection.getObject(field.getPGType(), getString(columnIndex)); + String type = field.getPGType(); + // if the backend doesn't know the type then coerce to String + if (type.equals("unknown")){ + return getString(columnIndex); + }else{ + return connection.getObject(field.getPGType(), getString(columnIndex)); + } } } diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java index 9df669910da..feec8d08c26 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java @@ -727,7 +727,13 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu case Types.VARBINARY: return getBytes(columnIndex); default: - return connection.getObject(field.getPGType(), getString(columnIndex)); + String type = field.getPGType(); + // if the backend doesn't know the type then coerce to String + if (type.equals("unknown")){ + return getString(columnIndex); + }else{ + return connection.getObject(field.getPGType(), getString(columnIndex)); + } } } |