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 1m3Oil-0004ma-8I for psycopg@arkaria.postgresql.org; Tue, 13 Jul 2021 20:09:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m3Oik-0007Iz-0P for psycopg@arkaria.postgresql.org; Tue, 13 Jul 2021 20:09:34 +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 1m3Oij-0007Ir-RB for psycopg@lists.postgresql.org; Tue, 13 Jul 2021 20:09:33 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3Oid-0005bP-0I for psycopg@postgresql.org; Tue, 13 Jul 2021 20:09:32 +0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 777602A0106 for ; Tue, 13 Jul 2021 13:09:24 -0700 (PDT) Date: Tue, 13 Jul 2021 13:09:24 -0700 (PDT) From: Rich Shepard Reply-To: Rich Shepard To: psycopg@postgresql.org Subject: New user questions Message-ID: User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I'm starting to learn psycopg2 and have read the basic module usage doc. Two questions on syntax: 1) I've seen a number of psycopg2 cursor execute examples where the select or insert statement is enclosed in a pydoc pair of three double quotes. Most examples in the basic module usage examples have a single pair of double quotes enclosing the statement; the named variable examples are exceptions. Is there a general rule when to use triple double quotes and when to use single double quotes? 2) How do I write a cursor execute UPDATE statement where the columns and values to be updated can be single or multiple and the values passed into the method from the tkinter widgets? Are there examples from which I can learn? Regards, Rich