Re: Query with boolean parameter

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Paolo De Stefani <paolo(at)paolodestefani(dot)it>
Cc: Psycopg <psycopg(at)postgresql(dot)org>
Subject: Re: Query with boolean parameter
Date: 2022-03-19 00:00:20
Message-ID: 74FC637F-2D25-4CD0-A075-9CB5293FCA5B@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

> On Mar 18, 2022, at 16:56, Paolo De Stefani <paolo(at)paolodestefani(dot)it> wrote:
> Is there any reason why the second query results in a syntax error?

There's not IS operator in PostgreSQL (or in SQL). IS NULL, IS NOT NULL, IS TRUE, and IS FALSE are in effect unary postfix operators, so you can't construct them that way via parameter substitution.

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Paolo De Stefani 2022-03-19 12:10:54 Re: Query with boolean parameter
Previous Message Paolo De Stefani 2022-03-18 23:56:28 Query with boolean parameter