From: Andrew McNamara <andrewm@object-craft.com.au>
To: Michael Meskes <meskes@postgresql.org>
Cc: PostgreSQL Interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: PQexecParams question
Date: Wed, 16 May 2007 09:13:42 +1000
Message-ID: <20070515231342.B9FDF5CC4B5@longblack.object-craft.com.au> (raw)
In-Reply-To: <20070515124419.GA31566@feivel.credativ.de>
References: <20070515124419.GA31566@feivel.credativ.de>
>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/
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-interfaces@postgresql.org
Cc: andrewm@object-craft.com.au, meskes@postgresql.org
Subject: Re: PQexecParams question
In-Reply-To: <20070515231342.B9FDF5CC4B5@longblack.object-craft.com.au>
* 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