Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create Array of ByteArrays for prepared statement #600

Open
obabichevjb opened this issue May 2, 2024 · 0 comments
Open

Unable to create Array of ByteArrays for prepared statement #600

obabichevjb opened this issue May 2, 2024 · 0 comments

Comments

@obabichevjb
Copy link

obabichevjb commented May 2, 2024

Version: 0.8.9

I have a table with the column of type bytea[]

I want to insert the value with a prepared statement into the table. To do that at one moment, I call something like this (Kotlin):

val statement: PGPreparedStatement = ...
val type = "bytea"
val array = arrayOf(byteArrayOf(0), byteArrayOf(1, 2, 3))
val argument = statement.connection.createArrayOf(type, array)

It works fine with the org.postgresql:postgresql:42.7.3, but fails with com.impossibl.pgjdbc-ng:pgjdbc-ng:0.8.9

The error occurred is the following:

com.impossibl.postgres.jdbc.PGSQLSimpleException: Error encoding array values
  at com.impossibl.postgres.jdbc.ErrorUtils.makeSQLException(ErrorUtils.java:151)
  at com.impossibl.postgres.jdbc.PGDirectConnection.createArrayOf(PGDirectConnection.java:1233)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant