Re: Query with boolean parameter

2022-03-18 Thread Christophe Pettus
> On Mar 18, 2022, at 16:56, Paolo De Stefani 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 w

Query with boolean parameter

2022-03-18 Thread Paolo De Stefani
Hi all Regarding query and parameter binding in psycopg3: cur.execute('SELECT * FROM system.app_user WHERE can_edit_views = %s', (True,)) user=postgres database=test4) at 0x127b7f0> cur.execute('SELECT * FROM system.app_user WHERE can_edit_views IS %s', (True,)) Traceback (most recent call las