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 1l7MDA-00029Q-Gh for psycopg@arkaria.postgresql.org; Wed, 03 Feb 2021 17:45:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l7MD9-0005so-EO for psycopg@arkaria.postgresql.org; Wed, 03 Feb 2021 17:45:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7MD9-0005sh-9S for psycopg@lists.postgresql.org; Wed, 03 Feb 2021 17:45:03 +0000 Received: from smtp114.iad3b.emailsrvr.com ([146.20.161.114]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7MD7-0006Hw-3M for psycopg@postgresql.org; Wed, 03 Feb 2021 17:45:02 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp7.relay.iad3b.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id E5CA060235; Wed, 3 Feb 2021 12:44:58 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.7\)) Subject: Re: about client-side cursors From: Christophe Pettus In-Reply-To: Date: Wed, 3 Feb 2021 09:44:57 -0800 Cc: psycopg@lists.postgresql.org, psycopg@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20210203161548.vkhu3qkpvmgvyhik@dalibo.com> <8E9B3B86-4691-4F09-B853-EA1F4CB86CF4@thebuild.com> To: Karsten Hilbert X-Mailer: Apple Mail (2.3445.9.7) X-Classification-ID: bda06da2-2812-46c9-bedc-829874954275-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Feb 3, 2021, at 09:41, Karsten Hilbert = wrote: > Perhaps client-side cursors were invented to make it possible > to code to the same API regardless of whether real > (server-side) cursors are used or not ? That's definitely part of it. The name "cursor" for the client-side object is a bit unfortunate, but = we need *something* there. The operations are: 1. Send query to server and execute it. 2. Retrieve results from server. Those are both asynchronous operations, and we need something to = encapsulate the state to pass from #1 to #2. You could just have the = connection object do that, but then we're declaring forever that we = can't run two queries at the same time on the same connection, and that = seems unwise. -- -- Christophe Pettus xof@thebuild.com