Skip site navigation (1) Skip section navigation (2)

PQexecParams question

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: PostgreSQL Interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: PQexecParams question
Date: 2007-05-15 12:44:19
Message-ID: 20070515124419.GA31566@feivel.credativ.de (view raw or flat)
Thread:
Lists: pgsql-interfaces
I had a closer look at PQexecParams and even started moving ecpglib to
use this function. However, there is one behaviour that troubles me
some.

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. 

Is this a feature? Essantially with this behaviour programmers do not
need to declare binary cursors at all because for a normal cursor the
behaviour is exactly the same.

I can surely work around this, for instance by calling PQexec instead
for fetch commands, which does the right thing, but I wonder if this is
desirable.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes(at)jabber(dot)org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

Responses

pgsql-interfaces by date

Next:From: Andrew McNamaraDate: 2007-05-15 23:13:42
Subject: Re: PQexecParams question
Previous:From: Sandeep KhandelwalDate: 2007-05-15 09:11:00
Subject: COPY command with bad input

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group