[Git][java-team/libpostgresql-jdbc-java][master] Fix org.postgresql.util.PSQLException: Unable to convert bytea parameter at...

Christoph Berg (@myon) gitlab at salsa.debian.org
Thu Apr 17 12:16:57 BST 2025



Christoph Berg pushed to branch master at Debian Java Maintainers / libpostgresql-jdbc-java


Commits:
47b8f1ab by Christoph Berg at 2025-04-17T11:16:50+00:00
Fix org.postgresql.util.PSQLException: Unable to convert bytea parameter at position 1 to literal. (Closes: #1098830)

- - - - -


3 changed files:

- debian/changelog
- debian/patches/series
- + debian/patches/tostring


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+libpgjava (42.7.5-2) unstable; urgency=medium
+
+  * Fix org.postgresql.util.PSQLException: Unable to convert bytea parameter
+    at position 1 to literal. (Closes: #1098830)
+
+ -- Christoph Berg <myon at debian.org>  Thu, 17 Apr 2025 11:14:38 +0000
+
 libpgjava (42.7.5-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/patches/series
=====================================
@@ -1 +1,2 @@
 02-scram-optional.patch
+tostring


=====================================
debian/patches/tostring
=====================================
@@ -0,0 +1,30 @@
+Fix org.postgresql.util.PSQLException: Unable to convert bytea parameter at position 1 to literal
+
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1098830
+https://github.com/pgjdbc/pgjdbc/issues/3365
+
+--- a/src/main/java/org/postgresql/core/v3/SimpleParameterList.java
++++ b/src/main/java/org/postgresql/core/v3/SimpleParameterList.java
+@@ -250,21 +250,7 @@ class SimpleParameterList implements V3P
+     String textValue;
+     String type;
+     if (paramTypes[index] == Oid.BYTEA) {
+-      try {
+-        return PGbytea.toPGLiteral(paramValue);
+-      } catch (Throwable e) {
+-        Throwable cause = e;
+-        if (!(cause instanceof IOException)) {
+-          // This is for compatibilty with the similar handling in QueryExecutorImpl
+-          cause = new IOException("Error writing bytes to stream", e);
+-        }
+-        throw sneakyThrow(
+-            new PSQLException(
+-                GT.tr("Unable to convert bytea parameter at position {0} to literal",
+-                    index),
+-                PSQLState.INVALID_PARAMETER_VALUE,
+-                cause));
+-      }
++        return "?";
+     }
+     if ((flags[index] & BINARY) == BINARY) {
+       // handle some of the numeric types



View it on GitLab: https://salsa.debian.org/java-team/libpostgresql-jdbc-java/-/commit/47b8f1ab0be85fe25be220fb40c5863e205b3778

-- 
View it on GitLab: https://salsa.debian.org/java-team/libpostgresql-jdbc-java/-/commit/47b8f1ab0be85fe25be220fb40c5863e205b3778
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20250417/bb7a1141/attachment.htm>


More information about the pkg-java-commits mailing list