JetBrains / Exposed

Kotlin SQL Framework
http://jetbrains.github.io/Exposed/
Apache License 2.0
8.05k stars 674 forks source link

EXPOSED-365 Unable to insert values into `Array` column #2072

Closed obabichevjb closed 2 months ago

obabichevjb commented 2 months ago

Fix for the column with type bytea[](array<ByteArray>()). FIxed by passing byte[][] instead of Object[] to the driver.

obabichevjb commented 2 months ago

As far as I understood everything correctly, the root of the problem is inside method statement.connection.createArrayOf() which fails if called with an argument of type Object[] that contains an array of byte[].

The solution is to pass byte[][] (Array<ByteArray>) there for the case of the column with byte arrays.

It doesn't work for pgjdbc-ng, but I'd expect that the problem is on the library side. I created there an issue https://github.com/impossibl/pgjdbc-ng/issues/600 . When it's resolved, it should be double-checked on our side also.