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 1l7gUo-0008Nw-GD for psycopg@arkaria.postgresql.org; Thu, 04 Feb 2021 15:24:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l7gUn-0002Nq-Em for psycopg@arkaria.postgresql.org; Thu, 04 Feb 2021 15:24:37 +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 1l7gUn-0002Ni-6s for psycopg@lists.postgresql.org; Thu, 04 Feb 2021 15:24:37 +0000 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l7gUl-0007jP-5U for psycopg@postgresql.org; Thu, 04 Feb 2021 15:24:36 +0000 Received: by mail-ot1-x335.google.com with SMTP id s107so3730504otb.8 for ; Thu, 04 Feb 2021 07:24:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D/gGQtqrgjyBEf+9Wv3w30NznmZ+7dGQRfSOZwWrFDA=; b=MUGWiONiZ4PRC5iTF8fTiCaw+RR1nLLioq1hNM2iYmt8qpb3V6yTYxGJs1yq2vxOSe ddPEEIXXX1jlX59NJJPczjFpgIGeomCM+l7ml1hcQnWIKJJXVYdtJHuE5nY14of0RRgp jQJYe4FWWLISnnbHTZnJ1G6Xv1Kqco6+aZyaZoqNxtckGLliAzeSQgA19Yc4D0cJBlZE 4Xdsg++c6a3wrZG7PIHMWYH64k/FNFRH3rm/i0sI7KcoQizdZPkAUfW5q+efZzAM+R4E ItBMTVRx5w5y/UvaaZs0mefz5H5UZDXZR7i/GUmCOUfEEmFAvTUvbqCZzOT2KILEKGwr RAwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=D/gGQtqrgjyBEf+9Wv3w30NznmZ+7dGQRfSOZwWrFDA=; b=uhjvV8jBM4JRiPsDHJ+i/pnEzmKuNSjrWSAXnKoMr9uU4iCIS3OBU4FpTic2c6iDsg 4q43SiLMmIB7e6mDmny83HliEzOs3xIfMRX4gOyOFfIzuZ703g0ympBgROdL+y6UiVpT TIMujfLoSscrk/iLe25DgMleaxMW7CdSuD7bKV7spScPv4BWo2sC/uLH+Pwckge1JBPX 76dyAc7tPBOGFnjbOFO68tZXkLcvvEJRJrV1HVga6TQ3lZtEzI6W/hBbtdsk5QPiYCDn x6wbzK9f/zpYjVUgAp4bxHiW5IpRpAeiUN3+ivWshk0EGPfUPJFHZpOc96SyoJNFZthQ 7ceg== X-Gm-Message-State: AOAM530umR3scGzM7PagFDLEIKdAwTsun41DpJ33b6V9wP5QCQgZ1RPo b7UG/wv28fgWwcb/lAJD7nAryf9TdnEMIEO0Eqq12GxnQSA3rhnB X-Google-Smtp-Source: ABdhPJzHT8Fb/BwX3Xs1SuDNs4VF5aX7lPcw2hAvdXQRgnExQTflrwb57i1OFCplS0VNtUKO7Ldt9jp7iHTEsWyg5m0= X-Received: by 2002:a05:6830:543:: with SMTP id l3mr6196016otb.241.1612452273408; Thu, 04 Feb 2021 07:24:33 -0800 (PST) MIME-Version: 1.0 References: <20210203161548.vkhu3qkpvmgvyhik@dalibo.com> <20210204111647.4s3qie5cnassksa5@dalibo.com> <20210204150203.iuophq3yx7nzpfzo@dalibo.com> <3BA6B9FE-9A00-4F04-9C0B-263EE4301985@thebuild.com> In-Reply-To: <3BA6B9FE-9A00-4F04-9C0B-263EE4301985@thebuild.com> From: Daniele Varrazzo Date: Thu, 4 Feb 2021 16:24:22 +0100 Message-ID: Subject: Re: about client-side cursors To: Christophe Pettus Cc: Denis Laxalde , psycopg@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 4 Feb 2021 at 16:17, Christophe Pettus wrote: > Having a single convenience method on the connection object that does the equivalent of a .execute() and a .fetchall() might be useful, though. You can already do it (in psycopg3): for record in conn.execute("query"): # do stuff or records = conn.execute("query").fetchall() or record = conn.execute("query").fetchone() The latter examples are two methods, not one, but I think they compose nicely enough, no? They are pretty orthogonal. -- Daniele