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 1l7hel-0003O3-J6 for psycopg@arkaria.postgresql.org; Thu, 04 Feb 2021 16:39:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l7hek-0005mf-HR for psycopg@arkaria.postgresql.org; Thu, 04 Feb 2021 16:38:58 +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 1l7hek-0005mY-7a for psycopg@lists.postgresql.org; Thu, 04 Feb 2021 16:38:58 +0000 Received: from mail1.dalibo.net ([212.83.143.11] helo=mail.dalibo.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7hei-0008N6-7x for psycopg@postgresql.org; Thu, 04 Feb 2021 16:38:57 +0000 Received: from dalibo.com (lan31-5-82-234-69-236.fbx.proxad.net [82.234.69.236]) by mail.dalibo.com (Postfix) with ESMTPSA id 7C9D620020; Thu, 4 Feb 2021 17:38:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1612456734; bh=Zo8y0qybTqAP/EoZbFjQulE8BprCosztpiox56g+rwM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U2yJfmoyGc+1G8Cvm1D2FJQqLHSF+Ml+pzhKuRSTugkm2O5Hb6Qgt79Kn2qxOEwTY wnIuOGPxTG36Y97Qf0wb7isQUbl823ILS5zobfbQSEWY1rbjH5GyP9L81bk2Z6Non1 GKImYWc5quEHVyHRst8AtKKF5WK2UaZO8fgziL1Y= Date: Thu, 4 Feb 2021 17:38:52 +0100 From: Denis Laxalde To: Christophe Pettus Cc: Daniele Varrazzo , psycopg@postgresql.org Subject: Re: about client-side cursors Message-ID: <20210204163852.5mwvddtr74aw6wrh@dalibo.com> References: <20210203161548.vkhu3qkpvmgvyhik@dalibo.com> <20210204111647.4s3qie5cnassksa5@dalibo.com> <20210204150203.iuophq3yx7nzpfzo@dalibo.com> <3BA6B9FE-9A00-4F04-9C0B-263EE4301985@thebuild.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3BA6B9FE-9A00-4F04-9C0B-263EE4301985@thebuild.com> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Christophe Pettus a écrit : > 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(). 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.) > It doesn't seem a good idea to guarantee > forever that .execute() will *never* do I/O without a database-side > cursor. Currently, it seems to me that .execute() always do IO with or without a database cursor.