Hi Matteo,

2013/7/2 Matteo Beccati <p...@beccati.com>
>
> > The API is not for ease of use, but for better performance as it
eliminate
> > needless hex conversions on both server and client side.
>
> What I meant is that we might have that speed improvements for free in
> PDO when bytea is used as a parameter (i.e. most likely insert/updates).
> With no visible change for the user and full backwards compatibility.


libpq's query API only has flag that returns all result as binary or text.

http://www.postgresql.org/docs/9.2/static/libpq-exec.html

PGresult *PQexecParams(PGconn *conn,
                       const char *command,
                       int nParams,
                       const Oid *paramTypes,
                       const char * const *paramValues,
                       const int *paramLengths,
                       const int *paramFormats,
                       int resultFormat);

resultFormat is the flag for returned values, binary or text.

resultFormat
  Specify zero to obtain results in text format, or one to obtain results
in
  binary format. (There is not currently a provision to obtain different
  result columns in different formats, although that is possible in the
  underlying protocol.)

How it could be done while there isn't API in libpq?
Does PDO pgsql driver use low level (protocol level) tweak?
I'll check code later, but I don't have time for now.

Regards,

--
Yasuo Ohgaki
yohg...@ohgaki.net

Reply via email to