Re: (When) can a single SQL statement return multiple result sets?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: (When) can a single SQL statement return multiple result sets?
Дата
Msg-id 169805.1712844454@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: (When) can a single SQL statement return multiple result sets?  (Thomas Kellerer <shammat@gmx.net>)
Список pgsql-general
Thomas Kellerer <shammat@gmx.net> writes:
> Tom Lane schrieb am 11.04.2024 um 01:02:
>> Jan Behrens <jbe-mlist@magnetkern.de> writes:
>>> While writing a PostgreSQL client library for Lua supporting
>>> Pipelining (using PQsendQueryParams), I have been wondering if there
>>> are any single SQL commands that return multiple result sets.

>> Right now, I don't think so.

> Hmm, what about functions returning multiple refcursors?

Sure, but let's distinguish between "here's an ugly workaround"
and "it just works".  Aside from being tedious, the refcursor
approach is restrictive: I don't think you can readily make
a refcursor on the result of INSERT/UPDATE/DELETE RETURNING,
nor on utility statements such as EXPLAIN.  (There might be
a way around the former restriction with WITH, but I'm
certain that won't work for EXPLAIN.)

            regards, tom lane



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

Предыдущее
От: ilya Basin
Дата:
Сообщение: [MASSMAIL] subquery plan rows = 1, but it's merge joined instead of index lookup
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: subquery plan rows = 1, but it's merge joined instead of index lookup