Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ouxP1-0001ze-1b for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Nov 2022 14:59:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ouxOz-0004Rr-Su for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Nov 2022 14:59:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ouxOz-0004QL-Gk for pgsql-hackers@lists.postgresql.org; Tue, 15 Nov 2022 14:59:05 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ouxOw-0007Ak-9d for pgsql-hackers@postgresql.org; Tue, 15 Nov 2022 14:59:04 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 1F40A5C0217; Tue, 15 Nov 2022 09:58:59 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 15 Nov 2022 09:58:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1668524339; x= 1668610739; bh=05WArPbIrZZXb+mAPKTmaPw5h8AgE0Y2x+1WZhJ1YU4=; b=f 1wZvuRWXG7zEg5mH9iwRVAsKbT/e1c4m7MdnOQ9Q8RIWciXzMO+AnEJdU2edOzaa hlePXKN7zffxQ63eni/RYcH64nkiER09f8MDIxmcvKwsVZdY2fQsVPaSKIC9a9KZ MiySz5Js40/Fku3rQeDDn5ICFLH2kEWKtpPYMWxoBZK+hDztmhiunOhDiznI5Aga KooiBgVB2ToF8wtRwHFYHkjD2IgfTiQP3nYTCkyoJnRWMSFY0VvhN1lpvtdHKkUJ +rlYy6dQP7sZDbNSJj+qV4LzWV6ETkZ83iG043e5j7AjkKfYKjS0AH+vm7Xmy5fR Ur+OyTE29Td9pfKCW/L0A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgeeggdejudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvg hrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnhepheelffeggedujeetiefh leetuddvieffhfffvdejvdffgeejkeduleduheduieefnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhht segvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Nov 2022 09:58:58 -0500 (EST) Message-ID: <747ac8ad-ec3d-1e68-1e8c-27b29410ac12@enterprisedb.com> Date: Tue, 15 Nov 2022 15:58:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: dynamic result sets support in extended query protocol Content-Language: en-US To: Pavel Stehule Cc: pgsql-hackers References: <6e747f98-835f-2e05-cde5-86ee444a7140@2ndquadrant.com> <20201009184625.4hfgpcxzd6jfredb@alap3.anarazel.de> <7e404216-62b5-93da-1a74-c1d5aa1fe47a@2ndquadrant.com> <6f038f18-0f2b-5271-a56f-1770577f246c@enterprisedb.com> <525d517f-72ab-9488-211b-ad3cb0aea3a3@enterprisedb.com> <20220112102055.fn5gpnt2lw6ii35o@jrouhaud> <4934178d-558b-f47c-36c0-7372152d5df6@enterprisedb.com> <34632858-a067-4ae5-bd49-6531e5ed9282@enterprisedb.com> From: Peter Eisentraut In-Reply-To: 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 14.10.22 19:22, Pavel Stehule wrote: > 1. there can be possibility to set "dynamic result sets" to unknown. The > behaviour of the "dynamic result sets" option is a little bit confusing. > I expect the number of result sets should be exactly the same as this > number. But the warning is raised only when this number is acrossed. For > this implementation the correct name should be like "max dynamic result > sets" or some like this. At this moment, I see this feature "dynamic > result sets" more confusing, and because the effect is just a warning, > then I don't see a strong benefit. I can see some benefit if I can > declare so CALL will be without dynamic result sets, or with exact > number of dynamic result sets or with unknown number of dynamic result > sets. And if the result is not expected, then an exception should be > raised (not warning). All of this is specified by the SQL standard. (What I mean by that is that if we want to deviate from that, we should have strong reasons beyond "it seems a bit odd".) > 2. Unfortunately, it doesn't work nicely with pagers. It starts a pager > for one result, and waits for the end, and starts pager for the second > result, and waits for the end. There is not a possibility to see all > results at one time. The current behavior is correct, but I don't think > it is user friendly. I think I can teach pspg to support multiple > documents. But I need a more robust protocol and some separators - > minimally an empty line (but some ascii control char can be safer). As > second step we can introduce new psql option like PSQL_MULTI_PAGER, that > can be used when possible result sets is higher than 1 I think that is unrelated to this patch. Multiple result sets already exist and libpq and psql handle them. This patch introduces another way in which multiple result sets can be produced on the server, but it doesn't touch the client side. So your concerns should be added either as a new feature or possibly as a bug against existing psql functionality.