Subject: [pgjdbc/pgjdbc] issue #3784: pgjdbc can't decode numeric arrays containing special numbers like NaN

From: "ShenFeng312 (@ShenFeng312)" <[email-masked]>
Date: Tue, 26 Aug 2025 03:09:57 +0000

pgjdbc can't decode numeric arrays containing special numbers like`NaN`

In fact, I know that pgjdbc uses a special double type to represent special numeric values. However, when converting to an array, it forces the use of `BigDecimal[]`. I’m wondering if we can change this behavior. I would like to use `Number[]` instead of `BigDecimal[]`. I’m not sure if this is

---

From: "ShenFeng312 (@ShenFeng312)" <[email-masked]>
Date: Tue, 26 Aug 2025 03:17:07 +0000

```java
  private static final ArrayDecoder<BigDecimal[]> BIG_DECIMAL_STRING_DECODER = new AbstractObjectStringArrayDecoder<BigDecimal[]>(
      BigDecimal.class) {

    @Override
    Object parseValue(String stringVal, BaseConnection connection) throws SQLException {
      return PgResultSet.toBigDecimal(stringVal);
    }
  };
```

---

From: "ShenFeng312 (@ShenFeng312)" <[email-masked]>
Date: Tue, 26 Aug 2025 03:32:03 +0000

Of course, encode has the same issue.

---

From: "ShenFeng312 (@ShenFeng312)" <[email-masked]>
Date: Thu, 09 Oct 2025 08:31:04 +0000

PTAL @davecramer @vlsi

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Thu, 09 Oct 2025 10:03:43 +0000

Any chance you could provide a PR ?