I have a workspace that is trying to upload a bytearray into an existing PostGIS table, into a ByteA column. The data is generated in a python caller.
Using INSERT, this works fine. There is no problem, and the resulting data can be read from a different client as expected.
However, using UPDATE it fails, stating:
Error executing SQL command ('update "public"."mesh_test" set "ogc_fid" = 694,"mesh" = E'\003\000\000\000\212\032\005H\004\362\336H33C@g\032\005H&\362\336H\205\353\021@\354\031\005H\004\362\336H\205\353\021@\001\000\000\000\000\000\000\000\002\000\000\000\001\000\000\000' WHERE "ogc_fid" = E'694''): 'ERROR: invalid byte sequence for encoding "UTF8": 0x00
I can circumvent the error by encoding it into base64, but that yields data I can't interpret from another client.
It seems that the update statement is done using a different method than the insert statement, which is odd. Has anyone seen this before?
EDIT: Added example workspace, plus sqlfile to create and populate table. You need to fill in the correct credentials as parameter.
EDIT2: The example workspace creates a new table, but I just tested: insert into the original table works as well perfectly.
EDIT3: INSERTING with bulk update set to NO gives the same error as updating.