Tomasz Ostrowski <tometzky@batory.org.pl> writes:
> Now for inserting data to a bytea we need 5*data_size in a buffer for
> escaped data representation. 6*data_size if we do PQescapeByteaConn
> in one chunk.
If you send the value as an out-of-line binary parameter then you don't
need any of that. See PQexecParams.
regards, tom lane