Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Mon, 11 May 2026 07:56:48 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #4063: fix: getCharacterStream wraps String in StringReader In-Reply-To: References: List-Id: X-GitHub-Author-Login: vlsi X-GitHub-Comment-Id: 4418612058 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 4063 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/4063#issuecomment-4418612058 Content-Type: text/plain; charset=utf-8 > if someone actually casts it to CharArrayReader in their code then it will break their code That is fair. `CharArrayReader` has been sitting there since 2002. On the other hand, `CharArrayReader` adds no new methods, and its `char[] buf` is protected, so I am leaning towards patch-level change. If we treat this as minor, then we would have to bump minor in virtually every change we make, which would render "minor bump" useless for the users. Frankly, I see two options: * We could consider this as an internal/bugfix/almost backward-compatible change. In that case we just fix it. * We could consider this as a user-visible/non backward-compatible change. In that case we should rather add an option to allow users switching to the new default, and after 2 years we could flip the default. I would accept either way (we shouldn't spent time on discussing the trivial changes), however, I would prefer just fix it as it is unlikely to break users' code. --- There's yet another possibility: the resultset holds `byte[]` + `encoding`. @dfa1 , have you evaluated/profiled the approach of using `new InputStreamReader(new ByteArrayInputStream(bytes), charset)` approach?