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 1rtGnQ-00Dc0n-4b for pgsql-hackers@arkaria.postgresql.org; Sun, 07 Apr 2024 00:54:08 +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 1rtGnO-001JA1-Lj for pgsql-hackers@arkaria.postgresql.org; Sun, 07 Apr 2024 00:54:06 +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 1rtGnO-001J9t-CA for pgsql-hackers@lists.postgresql.org; Sun, 07 Apr 2024 00:54:06 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rtGnL-001D2o-S0 for pgsql-hackers@postgresql.org; Sun, 07 Apr 2024 00:54:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4370ruiJ2631428; Sat, 6 Apr 2024 20:53:56 -0400 From: Tom Lane To: "Daniel Verite" cc: Laurenz Albe , PostgreSQL Hackers , Robert Haas , Jakub Wartak Subject: Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs In-reply-to: <484e1987-5a5b-4291-aad0-f4e71dfb2346@manitou-mail.org> References: <484e1987-5a5b-4291-aad0-f4e71dfb2346@manitou-mail.org> Comments: In-reply-to "Daniel Verite" message dated "Tue, 02 Apr 2024 22:54:47 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2631426.1712451236.1@sss.pgh.pa.us> Date: Sat, 06 Apr 2024 20:53:56 -0400 Message-ID: <2631427.1712451236@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk So what was really bothering me about this patchset was that I didn't think marginal performance gains were a sufficient reason to put a whole different operating mode into libpq. However, I've reconsidered after realizing that implementing FETCH_COUNT atop traditional single-row mode would require either merging single-row results into a bigger PGresult or persuading psql's results-printing code to accept an array of PGresults not just one. Either of those would be expensive and ugly, not to mention needing chunks of code we don't have today. Also, it doesn't really need to be a whole different operating mode. There's no reason that single-row mode shouldn't be exactly equivalent to chunk mode with chunk size 1, except for the result status code. (We've got to keep PGRES_SINGLE_TUPLE for the old behavior, but using that for a chunked result would be too confusing.) So I whacked the patch around till I liked it better, and pushed it. I hope my haste will not come back to bite me, but we are getting pretty hard up against the feature-freeze deadline. regards, tom lane