"Rudolf Leitgeb" <r(dot)leitgeb(at)x-pin(dot)com> writes:
> PQescapeByteaInternal uses sprintf to convert a byte to its octal
> representation, which slows down escaping of large BLOBs significantly.
Good point. Fixed in HEAD and 8.3 branches.
regards, tom lane