Re: specifying multiple result format codes with libpq

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Abhijit Menon-Sen <ams(at)wiw(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: specifying multiple result format codes with libpq
Date: 2004-06-18 17:11:19
Message-ID: 22625.1087578679@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Abhijit Menon-Sen <ams(at)wiw(dot)org> writes:
> The documentation for PQexecPrepared says:
> (There is not currently a provision to obtain different result
> columns in different formats, although that is possible in the
> underlying protocol.)

> Would anyone be interested in a patch to allow this?

Yes, but not the way you suggest. The ... approach forces calling code
to know *when it is written* how many result columns there will be,
because you'd have to actually write that number of parameters in the
call. This is true in some simple cases but it's way too inflexible.

AFAICS this would need additional libpq functions with different
signatures, viz a count+array of result formats. I desisted from doing
that in the 7.4 cycle because I thought the whole PQexec API probably
ought to be rethought in the light of the v3 protocol, and I didn't want
to provide a plethora of functions that would soon be deprecated.

No one's gotten around to thinking about a more general redesign of
libpq's query API yet, but I'd rather see us do that than put more
warts on the functions we have ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Carlos Guzmán Álvarez 2004-06-18 17:19:38 Timestamp format question
Previous Message Tom Lane 2004-06-18 16:09:58 Re: Casts question