I need help with write array[] bytea using libpq PQexecParams
I'v done a simple version where i'm write a single binary data in a single bytea arg using PQexecParams like this solution Insert Binary Large Object (BLOB) in PostgreSQL using libpq from remote machine
But I have problems with write array[] bytea like this
select * func(array[3, 4], array[bytea, bytea])
Unless you want to read the PostgreSQL source to figure out the binary format for arrays, you will have to use the text format, e.g.
The binary format for arrays is defined in
array_sendinsrc/backend/utils/adt/arrayfuncs.c. Have a look at the somments and definitions insrc/include/utils/array.has well. Consider also that all integers are sent in “network bit order”.One way you can examine the binary output format and saving yourself a lot of trouble experimenting is to use binary copy, e.g.