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 1nVc3u-0008GA-0C for psycopg@arkaria.postgresql.org; Sat, 19 Mar 2022 16:36:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nVc3s-0001hL-KW for psycopg@arkaria.postgresql.org; Sat, 19 Mar 2022 16:36:16 +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 1nVc3s-0001hC-EA for psycopg@lists.postgresql.org; Sat, 19 Mar 2022 16:36:16 +0000 Received: from smtp87.iad3b.emailsrvr.com ([146.20.161.87]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nVc3q-0001Rj-Dr for psycopg@postgresql.org; Sat, 19 Mar 2022 16:36:16 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp19.relay.iad3b.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 217DD400CD; Sat, 19 Mar 2022 12:36:10 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: Query with boolean parameter From: Christophe Pettus In-Reply-To: Date: Sat, 19 Mar 2022 09:35:08 -0700 Cc: Psycopg X-Mailbutler-Message-Id: 0B1718CB-4065-4930-90B1-424B3CFE3523 Content-Transfer-Encoding: quoted-printable Message-Id: References: <8df15d1263aaa1a9d36eacb0e5b9a28e@paolodestefani.it> <74FC637F-2D25-4CD0-A075-9CB5293FCA5B@thebuild.com> To: Paolo De Stefani X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Classification-ID: b1be3465-30ae-4807-85d4-2fe47b3f5e47-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Mar 19, 2022, at 05:10, Paolo De Stefani = wrote: > Switching to psycopg 3 i have to consider many more differences than i = expected There have been some changes in the way psycopg2 does parameter = substitution, although that one is an interesting case! You might = consider using IS DISTINCT FROM as Daniele suggested, or just =3D, = depending on how you want nulls handled.=