#53: Consider avoiding encoding/decoding bytea in queries
-------------------------+-----------------
 Reporter:  cito         |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  major        |  Milestone:  5.1
Component:  C Module     |    Version:  4.1
 Keywords:  bytea        |
-------------------------+-----------------
 Currently, when executing queries that contain `bytea` values on input or
 output, these are encoded from bytes and decoded to bytes on the level of
 the pgdb module and the pg.DB wrapper class.

 This is needed because on the lowest level we use the `PQexec()` method or
 the `PQexecParams()` method without setting `paramLengths` and
 `paramFormats`. In both cases, Postgres only uses text format for input
 and output, so we need to encode and decode.

 If we would always use `PQexecParams()` and set `paramLengths` and
 `paramFormats`, we could avoid the encoding and decoding between bytes and
 bytea text format, by passing these values in binary format.

 (Using binary could also speed up passing other parameters with types that
 have the same binary representation in Python and Postgres. But that could
 be brittle because it might depend on the Python and Postgres versions.
 However, bytes are always bytes, so it would be useful in the case of
 bytea. Also bytea values are usually big, so time and memory demand for
 encoding/decoding are more relevant for these.)

--
Ticket URL: <http://trac.pygresql.org:8000/trac/ticket/53>
PyGreSQL <http://www.pygresql.org/>
PyGreSQL Tracker
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to