Re: PQexecParams question

From: Andrew McNamara <andrewm(at)object-craft(dot)com(dot)au>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: PostgreSQL Interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: PQexecParams question
Date: 2007-05-15 23:13:42
Message-ID: 20070515231342.B9FDF5CC4B5@longblack.object-craft.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

>I declare a binary cursor using PQexecParams, which of course works
>nicely and then fetch data from it. I'm not able to tell whether the
>cursor is binary, unless I keep my own client side cursor list. So I
>call PQexecParams with the fetch command without knowing that the
>results are binary. Using the default values however all data is
>returned in ascii. It appears you have to tell the fetch command to
>return data in binary, or else it will return ascii, no matter how the
>cursor was defined.

In the documentation for the frontend/backend protocol, it says:

Note: The choice between text and binary output is determined
by the format codes given in Bind, regardless of the SQL command
involved. The BINARY attribute in cursor declarations is irrelevant
when using extended query protocol.

http://www.postgresql.org/docs/8.2/static/protocol-flow.html

PQexecParams does the Bind behind the scenes, the resultFormat parameter
deciding whether you get binary or text.

--
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Michael Meskes 2007-05-16 09:27:23 Re: PQexecParams question
Previous Message Michael Meskes 2007-05-15 12:44:19 PQexecParams question