diff --git a/pgjdbc/src/main/java/org/postgresql/core/Oid.java b/pgjdbc/src/main/java/org/postgresql/core/Oid.java index 430502272725d7135078f1c3c3867eb92757c853..001b21ffe1f58eb070b3a6065a3e7686708f37ae 100644 --- a/pgjdbc/src/main/java/org/postgresql/core/Oid.java +++ b/pgjdbc/src/main/java/org/postgresql/core/Oid.java @@ -54,10 +54,14 @@ public class Oid { public static final int BYTEA_ARRAY = 1001; public static final int VARCHAR = 1043; public static final int VARCHAR_ARRAY = 1015; + public static final int VARCHARC = 8005; + public static final int VARCHARC_ARRAY = 8073; public static final int OID = 26; public static final int OID_ARRAY = 1028; public static final int BPCHAR = 1042; public static final int BPCHAR_ARRAY = 1014; + public static final int BPCHARC = 8004; + public static final int BPCHARC_ARRAY = 8072; public static final int MONEY = 790; public static final int MONEY_ARRAY = 791; public static final int NAME = 19; diff --git a/pgjdbc/src/main/java/org/postgresql/jdbc/PgPreparedStatement.java b/pgjdbc/src/main/java/org/postgresql/jdbc/PgPreparedStatement.java index e412ae3c689150ca4ed2b2484a8d6126d62aa94b..3de637f497ddb86d74073c34cd1df13499628e54 100644 --- a/pgjdbc/src/main/java/org/postgresql/jdbc/PgPreparedStatement.java +++ b/pgjdbc/src/main/java/org/postgresql/jdbc/PgPreparedStatement.java @@ -599,9 +599,17 @@ class PgPreparedStatement extends PgStatement implements PreparedStatement { case Types.CHAR: setString(parameterIndex, castToString(in), Oid.BPCHAR); break; + // todo + case Oid.BPCHARC: + setString(parameterIndex, castToString(in), Oid.BPCHARC); + break; case Types.VARCHAR: setString(parameterIndex, castToString(in), Oid.VARCHAR); break; + // todo + case Oid.VARCHARC: + setString(parameterIndex, castToString(in), Oid.VARCHARC); + break; case Types.LONGVARCHAR: if (in instanceof InputStream) { preparedParameters.setText(parameterIndex, (InputStream)in); diff --git a/pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java b/pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java index ca5a23dfef8d8701f14ba192dc4af621e1378461..f97b6f05fbadf7cbf47fe5f5683c3b675a84151e 100644 --- a/pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java +++ b/pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java @@ -279,6 +279,8 @@ public class PgResultSet implements ResultSet, org.postgresql.PGRefCursorResultS case Types.FLOAT: case Types.DOUBLE: return getDouble(columnIndex); + case Oid.BPCHARC: + case Oid.VARCHARC: case Types.CHAR: case Types.VARCHAR: case Types.LONGVARCHAR: diff --git a/pgjdbc/src/main/java/org/postgresql/jdbc/TypeInfoCache.java b/pgjdbc/src/main/java/org/postgresql/jdbc/TypeInfoCache.java index af9a38cc01ffe8231438f71106cccf0920dd0bf5..9ebfa4ac9ec3e1c4909aab1d0f43a6b5fdb7d6af 100644 --- a/pgjdbc/src/main/java/org/postgresql/jdbc/TypeInfoCache.java +++ b/pgjdbc/src/main/java/org/postgresql/jdbc/TypeInfoCache.java @@ -86,7 +86,9 @@ public class TypeInfoCache implements TypeInfo { {"float8", Oid.FLOAT8, Types.DOUBLE, "java.lang.Double", Oid.FLOAT8_ARRAY}, {"char", Oid.CHAR, Types.CHAR, "java.lang.String", Oid.CHAR_ARRAY}, {"bpchar", Oid.BPCHAR, Types.CHAR, "java.lang.String", Oid.BPCHAR_ARRAY}, + {"bpcharc", Oid.BPCHARC, Types.CHAR, "java.lang.String", Oid.BPCHARC_ARRAY}, {"varchar", Oid.VARCHAR, Types.VARCHAR, "java.lang.String", Oid.VARCHAR_ARRAY}, + {"varcharc", Oid.VARCHARC, Types.VARCHAR, "java.lang.String", Oid.VARCHARC_ARRAY}, {"text", Oid.TEXT, Types.VARCHAR, "java.lang.String", Oid.TEXT_ARRAY}, {"name", Oid.NAME, Types.VARCHAR, "java.lang.String", Oid.NAME_ARRAY}, {"bytea", Oid.BYTEA, Types.BINARY, "[B", Oid.BYTEA_ARRAY},