Message-ID: From: "miroslav-vacek (@miroslav-vacek)" To: "pgjdbc/pgjdbc" Date: Wed, 26 Feb 2025 14:32:31 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #3365: EOFException on PreparedStatement#toString with unset bytea parameter since 42.7.4 In-Reply-To: References: List-Id: X-GitHub-Author-Login: miroslav-vacek X-GitHub-Comment-Id: 2685208174 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3365 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3365#issuecomment-2685208174 Content-Type: text/plain; charset=utf-8 Hello there. I think I encountered this very problem in slightly different context. For me a batch insert is failing when one of the statements in the batch raises an exception (in my case primary key violation). When this happens it is the PostgreSQL JDBC driver that internally invokes `PreparedStatement.toString()` in [BatchResultHandler.java#L156](https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/jdbc/BatchResultHandler.java#L156). I was able to bypass the issue by setting `logServerErrorDetail=false` in JDBC URL but it is not ideal. I am sharing this to illustrate the issue described here might be more severe than it appears to be. It is not strictly limited to end user call of `PreparedStatement.toString()`. The PostgreSQL JDBC driver itself makes such a call in `BatchResultHandler` and perhaps even someplace else.