Im currently trying to optimise data loading in Postgres via JDBC. We are using COPY FROM STDIN with FORMAT 'binary' Now building the binary byte arrays is pretty straight forward for strings, longs, uuid's etc. However in one instance we have a JSONB field in the table and I have no idea how to serialize my json objects into the binary jsonb format. Is there any specification anywhere for jsonb?
Note: I have ruled out just sending a utf-8 binary serialized json string.