Re: specifying multiple result format codes with libpq

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

At 2004-06-18 13:11:19 -0400, tgl(at)sss(dot)pgh(dot)pa(dot)us wrote:
>
> > 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.

I suspect I didn't explain my proposal sufficiently well.

The signature of, say, PQexecParams does get ... added on to it, but new
callers pass in only a count and an array, not one argument per expected
result. That way, existing callers would continue to compile without any
changes, and new code tells the function to look for the extra arguments
by specifying a currently-invalid value for the resultFormat parameter.

That said, however:

> 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 ...

I am in complete agreement with that sentiment.

-- ams

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-06-18 22:14:15 Re: Tablespace patch review
Previous Message Gavin Sherry 2004-06-18 22:12:51 Re: Tablespace patch review