8000 Use BigDecimal instead of Double per @alaisi · juliombb/postgres-async-driver@bbd07d8 · GitHub
[go: up one dir, main page]

Skip to content

Commit bbd07d8

Browse files
1 parent b47f0a0 commit bbd07d8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/java/com/github/pgasync/impl/conversion/DataConverter.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,11 @@ public <TArray> TArray toArray(Class<TArray> arrayType, Oid oid, byte[] value) {
8484
case VARCHAR_ARRAY:
8585
return ArrayConversions.toArray(arrayType, oid, value, StringConversions::toString);
8686

87+
case NUMERIC_ARRAY:
8788
case FLOAT4_ARRAY:
8889
case FLOAT8_ARRAY:
8990
return ArrayConversions.toArray(arrayType, oid, value, NumericConversions::toBigDecimal);
9091

91-
case NUMERIC_ARRAY:
92-
return ArrayConversions.toArray(arrayType, oid, value, NumericConversions::toDouble);
93-
9492
case TIMESTAMP_ARRAY:
9593
case TIMESTAMPTZ_ARRAY:
9694
return ArrayConversions.toArray(arrayType, oid, value, TemporalConversions::toTimestamp);
@@ -179,9 +177,9 @@ public Object toObject(Oid oid, byte[] value) {
179177
case INT2: return toShort(oid, value);
180178
case INT4: return toInteger(oid, value);
181179
case INT8: return toLong(oid, value);
180+
case NUMERIC: // fallthrough
182181
case FLOAT4: // fallthrough
183182
case FLOAT8: return toBigDecimal(oid, value);
184-
case NUMERIC: return toDouble(oid, value);
185183
case BYTEA: return toBytes(oid, value);
186184
case DATE: return toDate(oid, value);
187185
case TIMETZ: // fallthrough
@@ -194,6 +192,7 @@ public Object toObject(Oid oid, byte[] value) {
194192
case INT2_ARRAY:
195193
case INT4_ARRAY:
196194
case INT8_ARRAY:
195+
case NUMERIC_ARRAY:
197196
case FLOAT4_ARRAY:
198197
case FLOAT8_ARRAY:
199198
case TEXT_ARRAY:

0 commit comments

Comments
 (0)
0