| От | Tom Lane |
|---|---|
| Тема | Re: Returning multiple cursors from PL/PgSQL |
| Дата | |
| Msg-id | 12369.1105641898@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Returning multiple cursors from PL/PgSQL (David Fetter <david@fetter.org>) |
| Список | pgsql-patches |
David Fetter <david@fetter.org> writes:
>> Please find attached an example that allows people to return multiple
>> named refcursors from a function. Big kudos to Kris Jurka for
>> figuring this out and pasting to rafb :)
> Oops. Joe Conway pointed out that this patch could be more succinct
> and not create an essentially useless new type.
I think the example is pretty confusing, or at least not compelling,
since it's not clear to the reader why you'd go to all that trouble
to return two scalars. The cursors ought to return rowsets.
Maybe
+ OPEN $1 FOR SELECT * FROM table1;
+ RETURN NEXT $1;
+ OPEN $2 FOR SELECT * FROM table2;
+ RETURN NEXT $2;
regards, tom lane
В списке pgsql-patches по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера