Re: (When) can a single SQL statement return multiple result sets?
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Tom Lane <tgl@sss.pgh.pa.us>, Jan Behrens <jbe-mlist@magnetkern.de>
Cc: pgsql-general@lists.postgresql.org
Date: 2024-04-15T14:55:43Z
Lists: pgsql-general
On 11.04.24 01:02, Tom Lane wrote: >> And if not, why can't I write a stored procedure >> or function that returns multiple result sets? > > [ shrug... ] Lack of round tuits, perhaps. We don't have any > mechanism today whereby a stored procedure could say "please ship > this resultset off to the client, but I want to continue afterwards". > But you can do that in other RDBMSes and probably somebody will be > motivated to make it possible in Postgres. The development of this feature was the subject of this thread: https://www.postgresql.org/message-id/flat/6e747f98-835f-2e05-cde5-86ee444a7140@2ndquadrant.com But it has not concluded successfully yet.