postgresql-jdbc.git / summary / log / commit / refs
commit d313138ee1291220feccccb686d00643ea2e794f
Author: Eugene Koontz <ekoontz@hiro-tan.org>
Date: Sat Jul 04 18:51:41 2015 +0000
Add support within "private Object buildArray (PgArrayList input, int index, int count)" for
array elements whose type is jsonb
- define Oid.JSONB_ARRAY = 3807 (from Postgres's src/include/catalog/pg_type.h)
- compare field's type (its oid) against this new Oid.JSONB_ARRAY in buildArray().
org/postgresql/core/Oid.java | 1 +
org/postgresql/jdbc2/AbstractJdbc2Array.java | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/org/postgresql/core/Oid.java b/org/postgresql/core/Oid.java
index b9633986..5d87a360 100644
--- a/org/postgresql/core/Oid.java
+++ b/org/postgresql/core/Oid.java
@@ -72,6 +72,7 @@ public class Oid {
public static final int XML_ARRAY = 143;
public static final int POINT = 600;
public static final int BOX = 603;
+ public static final int JSONB_ARRAY = 3807;
/**
* Returns the name of the oid as string.
diff --git a/org/postgresql/jdbc2/AbstractJdbc2Array.java b/org/postgresql/jdbc2/AbstractJdbc2Array.java
index 6918ff27..1cb0b0c6 100644
--- a/org/postgresql/jdbc2/AbstractJdbc2Array.java
+++ b/org/postgresql/jdbc2/AbstractJdbc2Array.java
@@ -698,7 +698,7 @@ public abstract class AbstractJdbc2Array
}
}
- else if (type == Types.CHAR || type == Types.VARCHAR)
+ else if (type == Types.CHAR || type == Types.VARCHAR || oid == Oid.JSONB_ARRAY)
{
Object[] oa = null;
ret = oa = (dims > 1 ? (Object[]) java.lang.reflect.Array.newInstance(String.class, dimsLength) : new String[count]);
[parent: 54b2d65ae16b]