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 1l7hkD-0003Wd-Kq for psycopg@arkaria.postgresql.org; Thu, 04 Feb 2021 16:44:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l7hkC-00028l-IA for psycopg@arkaria.postgresql.org; Thu, 04 Feb 2021 16:44:36 +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 1l7hkC-00028e-AQ for psycopg@lists.postgresql.org; Thu, 04 Feb 2021 16:44:36 +0000 Received: from smtp78.ord1d.emailsrvr.com ([184.106.54.78]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7hk9-000619-UX for psycopg@postgresql.org; Thu, 04 Feb 2021 16:44:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=g001.emailsrvr.com; s=20190322-9u7zjiwi; t=1612457072; bh=vGz8+hHR7002s01xommVw4QXyzxtj06ckkCc9rmklOM=; h=Subject:From:Date:To:From; b=VGRXfxYt/QBeF05MTLMSgGISUO1GTL9hJd1K4sWDNIy0tq4m24g9hHnEwJPNK82je YsY8xYjc4sMst8XwwWqjfMmYfHft9Ok7p/A0KFqQpPuN9MmS2EDVJwEW7BHVDkFBEU v3fNvyUrjqy9L4T+p3mOs5jrm6OpAoEcZh7gAPPY= X-Auth-ID: xof@thebuild.com Received: by smtp18.relay.ord1d.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 34A9FA022A; Thu, 4 Feb 2021 11:44:32 -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: <20210204163852.5mwvddtr74aw6wrh@dalibo.com> Date: Thu, 4 Feb 2021 08:44:31 -0800 Cc: Daniele Varrazzo , psycopg@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <9E627534-4E82-405E-AC6B-45D73C25989B@thebuild.com> References: <20210203161548.vkhu3qkpvmgvyhik@dalibo.com> <20210204111647.4s3qie5cnassksa5@dalibo.com> <20210204150203.iuophq3yx7nzpfzo@dalibo.com> <3BA6B9FE-9A00-4F04-9C0B-263EE4301985@thebuild.com> <20210204163852.5mwvddtr74aw6wrh@dalibo.com> To: Denis Laxalde X-Mailer: Apple Mail (2.3445.9.7) X-Classification-ID: 7273d087-bd1b-4463-9efe-a57564ff1dae-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Feb 4, 2021, at 08:38, Denis Laxalde = wrote: > Is this related to prepared statements in the extended query protocol? > (Then, I'd argue that both preparation and execution steps would = involve > IO. But if it's not a cursor, we should use a different name, as > postgresql doc does.) No, this is separate from prepared statements or the extended protocol. = You can do single-row returns with either basic or extended protocol. It's unfortunate that cursor as become overloaded, but I think that's = something we just have to accept at this point. It sounds like the real = issue is that it would be convenient to have a single async function = that does the semantic equivalent of: curs =3D connection.cursor() curs.execute(query, *parameters) for row in curs.fetchall(): yield row curs.close() -- -- Christophe Pettus xof@thebuild.com