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 1l7gOD-0007zn-1k for psycopg@arkaria.postgresql.org; Thu, 04 Feb 2021 15:17:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l7gOB-0003IG-Vg for psycopg@arkaria.postgresql.org; Thu, 04 Feb 2021 15:17:47 +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 1l7gOB-0003I9-Qd for psycopg@lists.postgresql.org; Thu, 04 Feb 2021 15:17:47 +0000 Received: from smtp98.iad3b.emailsrvr.com ([146.20.161.98]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7gO4-0007gJ-NW for psycopg@postgresql.org; Thu, 04 Feb 2021 15:17:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=g001.emailsrvr.com; s=20190322-9u7zjiwi; t=1612451858; bh=Dg4S/hLfJ6RaXWMvoptHYJJuQbfkhQlYkeh0+AqCxYI=; h=Subject:From:Date:To:From; b=Tbbc1n1YXGiMy/uyMx8v+EyCjtfLnwc9LcuKWvgl43x0nlVR0+8KXH0RGgp22QHSn lj6p7nZfPR9tvWkYZQlXG85FublvQMbVt1hqi+xzxrwk8Hf6U2UmOEQ7cq4gcG9+sc 2h9M/BBQQJG8l76TPWtYzqnvsc7vBLdDMO146y4c= X-Auth-ID: xof@thebuild.com Received: by smtp13.relay.iad3b.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 71D2E60245; Thu, 4 Feb 2021 10:17:38 -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: <20210204150203.iuophq3yx7nzpfzo@dalibo.com> Date: Thu, 4 Feb 2021 07:17:37 -0800 Cc: Daniele Varrazzo , psycopg@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <3BA6B9FE-9A00-4F04-9C0B-263EE4301985@thebuild.com> References: <20210203161548.vkhu3qkpvmgvyhik@dalibo.com> <20210204111647.4s3qie5cnassksa5@dalibo.com> <20210204150203.iuophq3yx7nzpfzo@dalibo.com> To: Denis Laxalde X-Mailer: Apple Mail (2.3445.9.7) X-Classification-ID: 9300828b-01c1-41e2-8388-e724497d40eb-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Feb 4, 2021, at 07:02, Denis Laxalde = wrote: >=20 > If "cursor" is a real database cursor, I agree. But it's not just CURSORs that have this behavior. libpq allows the = client to the send the query, and then make separate requests for each = row, even without a database cursor; this maps almost exactly to = .execute() and .fetchone(). It doesn't seem a good idea to guarantee = forever that .execute() will *never* do I/O without a database-side = cursor. Having a single convenience method on the connection object that does = the equivalent of a .execute() and a .fetchall() might be useful, = though. -- -- Christophe Pettus xof@thebuild.com