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 1l7fri-0006gu-Qu for psycopg@arkaria.postgresql.org; Thu, 04 Feb 2021 14:44:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l7frh-0005wp-Ny for psycopg@arkaria.postgresql.org; Thu, 04 Feb 2021 14:44:13 +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 1l7frh-0005wi-CR for psycopg@lists.postgresql.org; Thu, 04 Feb 2021 14:44:13 +0000 Received: from smtp84.iad3b.emailsrvr.com ([146.20.161.84]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7fre-00051R-I9 for psycopg@postgresql.org; Thu, 04 Feb 2021 14:44:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=g001.emailsrvr.com; s=20190322-9u7zjiwi; t=1612449849; bh=gC4xcXFbODzVtxNDGnmyGFusghqvdGGYjotRgk1XDuw=; h=Subject:From:Date:To:From; b=s2Syg01VLuOp8Npld1OvkvkvAF20AGe1K4BzF20xySl/OsOzAyw/rC0WwTB6HUR0b 0YpGcQKGjO5wuednigklbu+HqPNn+9gMVZ9fEblZq8X96HG6gxfEm1MsvQY2eB9Tte 8fa5v1TVdIBoPcco70nJ076dzl3J7Shpk6OBODD4= X-Auth-ID: xof@thebuild.com Received: by smtp19.relay.iad3b.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 0A31E40219; Thu, 4 Feb 2021 09:44:08 -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: <20210204111647.4s3qie5cnassksa5@dalibo.com> Date: Thu, 4 Feb 2021 06:44:07 -0800 Cc: Daniele Varrazzo , psycopg@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20210203161548.vkhu3qkpvmgvyhik@dalibo.com> <20210204111647.4s3qie5cnassksa5@dalibo.com> To: Denis Laxalde X-Mailer: Apple Mail (2.3445.9.7) X-Classification-ID: 1120b378-8894-42aa-b4ab-166aa852f907-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Feb 4, 2021, at 03:16, Denis Laxalde = wrote: > But, unless I missed it, the PEP does not state how to implement query > execution and result fetch operations if the database does not need a > cursor. First, any change like this would have to maintain their current API = essentially forever, unless psycopg3 represents a completely = incompatible break with the psycopg2 interface. There is an enormous = body of code out there that uses the current cursor() interface for = client-side cursors. Second, it would be very unwise to make guarantees about when these = operations interact with the database. I think that any client = application should expect that both cursor.execute() and = cursor.fetchone()/.fetchall() are asynchronous operations, and code = appropriately. -- -- Christophe Pettus xof@thebuild.com