Re: Using Cursor in PostgreSQL 7.2

Поиск
Список
Период
Сортировка
От Holger Krug
Тема Re: Using Cursor in PostgreSQL 7.2
Дата
Msg-id 20011207200611.B1462@dev12.rationalizer.com
обсуждение исходный текст
Ответ на Re: Using Cursor in PostgreSQL 7.2  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Fri, Dec 07, 2001 at 12:38:03PM -0500, Tom Lane wrote:
> C functions returning sets are entirely possible, and there's even some
> documentation about how to do it in src/backend/utils/fmgr/README (which
> needs to be transposed to present tense and moved into the SGML docs,
> but it's better than nothing).

Thank you ! I very appreciate your answer.

So what I have to do to let a PL/PGSQL function to return a set to the
client is:

1) let the PL/PGSQL return a cursor
2) write a general C wrapper function cursor_to_set(cursor) which gets a
   cursor and returns the result set

My additional questions:

* Is 2) possible if the nature of the cursor is not known in advance ?
* Is the implementation of cursor_to_set very complicated or can it done
  with the documentation cited in your mail ?

I think such a function cursor_to_set, if possible, would be very
useful, wouldn't it ?

> There is not presently any support for this sort of thing in plpgsql
> or any of the other PL languages, however.

Having `cursor_to_set' it would be half as bad !

--
Holger Krug
hkrug@rationalizer.com

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

Предыдущее
От: Brett Schwarz
Дата:
Сообщение: Re: Errors: Too many open files
Следующее
От: Holger Krug
Дата:
Сообщение: Re: Where is PL/Python?