Re: have you feel anything when you read this ? - Mailing list pgsql-sql

From Michael Glaesemann
Subject Re: have you feel anything when you read this ?
Date
Msg-id C5B23B63-8483-426D-BA2F-74674FF3F06D@myrealbox.com
Whole thread Raw
In response to Re: have you feel anything when you read this ?  ("Eugene E." <sad@bankir.ru>)
List pgsql-sql
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





pgsql-sql by date:

Previous
From: "Eugene E."
Date:
Subject: Re: have you feel anything when you read this ?
Next
From: Stephan Szabo
Date:
Subject: Re: have you feel anything when you read this ?