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.96) (envelope-from ) id 1vNVt7-004zvU-2X for pgsql-interfaces@arkaria.postgresql.org; Mon, 24 Nov 2025 12:41:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vNVt6-000ri3-1I for pgsql-interfaces@arkaria.postgresql.org; Mon, 24 Nov 2025 12:41:48 +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.96) (envelope-from ) id 1vNVt6-000rhu-0Z for pgsql-interfaces@lists.postgresql.org; Mon, 24 Nov 2025 12:41:48 +0000 Received: from dverite2024.planet-service.net ([185.16.44.252] helo=mail.verite.pro) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vNVt4-001EKq-18 for pgsql-interfaces@lists.postgresql.org; Mon, 24 Nov 2025 12:41:48 +0000 Received: by mail.verite.pro (Postfix, from userid 1000) id A8CD82C0430; Mon, 24 Nov 2025 13:41:44 +0100 (CET) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "Daniel Verite" Subject: Re: ECPG support for PQsetChunkedRowsMode() To: "Tim Fors" Cc: pgsql-interfaces@lists.postgresql.org In-Reply-To: Date: Mon, 24 Nov 2025 13:41:40 +0100 Message-Id: X-Mailer: Manitou v1.7.3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tim Fors wrote: > Note that ECPG supports using a C array as a host variable, and in > that case there's a bulk transfer of rows from the client to the > server, so performance is much better than getting the rows one at a > time using a cursor. However, AFAIK this is not standard coding > practice - one expects to be able to use the cursor to FETCH one > row at a time, but still offer good performance. It's just a preprocessor. If the C code has EXEC SQL FETCH NEXT, it's going to emit code sending a FETCH NEXT [1] SQL statement. But aside from the arrays you mention, it allows retrieving several rows at a time through a cursor, so the client-side can still reduce the round-trips to the server. See this example in [2]: EXEC SQL FETCH 3 FROM mycursor INTO DESCRIPTOR mysqlda; [1]: https://www.postgresql.org/docs/current/sql-fetch.html [2]: https://www.postgresql.org/docs/current/ecpg-descriptors.html Best regards, --=20 Daniel V=E9rit=E9=20 https://postgresql.verite.pro/