Re: specifying multiple result format codes with libpq

Поиск
Список
Период
Сортировка
От Abhijit Menon-Sen
Тема Re: specifying multiple result format codes with libpq
Дата
Msg-id 20040619034323.B14517@lustre.dyn.wiw.org
обсуждение исходный текст
Ответ на Re: specifying multiple result format codes with libpq  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
At 2004-06-18 13:11:19 -0400, tgl@sss.pgh.pa.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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Carlos Guzmán Álvarez
Дата:
Сообщение: Re: Timestamp format question
Следующее
От: "Dave Page"
Дата:
Сообщение: Cannot initdb in cvs tip