Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rwNkW-001He6-Aq for pgsql-general@arkaria.postgresql.org; Mon, 15 Apr 2024 14:56:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rwNkU-00DdaB-VN for pgsql-general@arkaria.postgresql.org; Mon, 15 Apr 2024 14:55:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rwNkS-00DdYy-Tu for pgsql-general@lists.postgresql.org; Mon, 15 Apr 2024 14:55:58 +0000 Received: from wfhigh5-smtp.messagingengine.com ([64.147.123.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rwNkO-00160c-1z for pgsql-general@lists.postgresql.org; Mon, 15 Apr 2024 14:55:56 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.west.internal (Postfix) with ESMTP id AAEE51800113; Mon, 15 Apr 2024 10:55:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 15 Apr 2024 10:55:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1713192947; x=1713279347; bh=7TO3YpjxNodt/LTsuwBgRR1AfRLwtbPr 6TLdUao9UFk=; b=u/6IQLOGcDahnrwapN4Fwb/5i5Iy0k1eQRJHqr7Noe3BW0su xz03JxY0XUj3Djfc2QdQ2kyW8G43fHDcYabUgBKYK/B9poEeDrb4n9lneyDy2UEH dooaPyI7119fVfDV6zT5iji2EFJQ9qBArJdoCj58FJqFzV+LT4JhVSMoj+VhjFQb L3qAGL9M87KqrZfsuPYk0Mtqs/zxDDoBV/Urza6OhjKfrYtQdROzY5OxhltzC2Q8 e+DX4uBguklcvK+rRE/SZAU93vp3hFRFmIPwQWytom81YnybaaTqen0pedZn4vOx R46efMk1hFrqIG9TT1+XvDV1fzwVCiablYdeoQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1713192947; x= 1713279347; bh=7TO3YpjxNodt/LTsuwBgRR1AfRLwtbPr6TLdUao9UFk=; b=a xmk4vsL9QppIUfFf+2nYJdrYSLhBE7vV9c8nZgr9q+n/D8nhLcfUZTiXq95QQTHS cZmdxQy7ANUYSaIL83Be/Lih9epEhapTBH/IweAPD5Q66q2YugjHqvLg7ZIBLxit uPsoxXlMJrAj8syCsiuE3MzufJWlKZ3f7fKx/smLM/PpvWDUrHhd3ij80bp+QQws qs8k66LMwxDersjWMSXgX+BbVXcmao8Ej6pUU4+04nS6AteUprtZHQXytPBsg17b 2jH5XCOWO60mucp4YdLuMl2nOP2YNhIA4EtMv3rAqYfSJhfi65+EuzA9AjKEJghT lxt6nC+D38Vs7oo+GvlSQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejvddgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfevfhfhjggtgfesth ejredttddvjeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgv rhesvghishgvnhhtrhgruhhtrdhorhhgqeenucggtffrrghtthgvrhhnpeeljedtudfggf fffefhieetfeehtedukeejuedtlefhgefgffdujeehueefudffkeenucffohhmrghinhep phhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 15 Apr 2024 10:55:46 -0400 (EDT) Message-ID: <9ef79e99-fc9c-4328-b272-31d9011734a4@eisentraut.org> Date: Mon, 15 Apr 2024 16:55:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: (When) can a single SQL statement return multiple result sets? To: Tom Lane , Jan Behrens Cc: pgsql-general@lists.postgresql.org References: <20240410232247.b48cdf2677f87d37b167e140@magnetkern.de> <7504.1712790168@sss.pgh.pa.us> Content-Language: en-US From: Peter Eisentraut In-Reply-To: <7504.1712790168@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.