From: Michael Glaesemann <grzm@myrealbox.com>
To: Eugene E. <sad@bankir.ru>
Cc: postgresql sql list <pgsql-sql@postgresql.org>
Subject: Re: have you feel anything when you read this ?
Date: Tue, 4 Apr 2006 20:05:41 +0900
Message-ID: <C5B23B63-8483-426D-BA2F-74674FF3F06D@myrealbox.com> (raw)
In-Reply-To: <44324AB6.2060104@bankir.ru>
References: <Pine.LNX.4.44.0603201522410.22894-100000@matrix.gatewaynet.com>
<441EA0A7.8030601@bankir.ru>
<200603201415.30719.peter_e@gmx.net>
<442CC95C.1030700@bankir.ru>
<20060331084503.W64402@megazone.bigpanda.com>
<44324AB6.2060104@bankir.ru>
On Apr 4, 2006, at 19:30 , Eugene E. wrote:
> Stephan Szabo wrote:
>> On Fri, 31 Mar 2006, Eugene E. wrote:
>>> Peter Eisentraut wrote:
>>>
>> No, that is still using the textual form. If you use PQexecParams
>> and set
>> the last argument to show you want binary data, you should get binary
>> data.
>
> Documentation says:
> ===
> PQexecParams
>
> Submits a command to the server and waits for the result, with
> the ability to pass parameters separately from the SQL command text.
> ===
>
> How should i use this func to change so-called "textual form" of a
> select-result to so-called "binary form" ?
It looks like you quoted
http://www.postgresql.org/docs/8.1/interactive/libpq-exec.html#AEN25123
If you read the rest of the explanation of PQexecParams, I think
you'll find the answer you're looking for. (Please note I don't have
any experience using libpq. I'm just trying to help you find an
answer to your question.)
The usage block includes the parameters PQexecParams accepts.
> PGresult *PQexecParams(PGconn *conn,
> const char *command,
> int nParams,
> const Oid *paramTypes,
> const char * const *paramValues,
> const int *paramLengths,
> const int *paramFormats,
> int resultFormat);
That last parameter (resultFormat) looks promising.
The next sentence gives query result formats:
> PQexecParams is like PQexec, but offers additional functionality:
> parameter values can be specified separately from the command
> string proper, and query results can be requested in either text or
> binary format.
And in the next paragraph:
> ... resultFormat is zero to obtain results in text format, or one
> to obtain results in binary format. ...
Hope this helps.
Michael Glaesemann
grzm myrealbox com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: grzm@myrealbox.com, sad@bankir.ru
Subject: Re: have you feel anything when you read this ?
In-Reply-To: <C5B23B63-8483-426D-BA2F-74674FF3F06D@myrealbox.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox