Re: UPDATE with AND clarification - Mailing list pgsql-sql

From David G. Johnston
Subject Re: UPDATE with AND clarification
Date
Msg-id CAKFQuwbrQUPOPhPQbor2=Fhi73bZPm-PYa4aV9oCERZD8SqwLA@mail.gmail.com
Whole thread Raw
In response to UPDATE with AND clarification  (Jamie Thompson <jthompson.neuk@gmail.com>)
Responses Re: UPDATE with AND clarification  (Jamie Thompson <jthompson.neuk@gmail.com>)
List pgsql-sql
On Friday, March 22, 2024, Jamie Thompson <jthompson.neuk@gmail.com> wrote:

Earlier today, I was running some sql for someone which they had submitted as:
> UPDATE tablename SET col1 = val1 AND col2 = val2 WHERE id = X

I presume these columns are booleans.  So you wrote something like:
Set col1 = ( true and false = true )

Which in this case must coincidentally have produced whatever boolean value already existed in col1.

David J.

pgsql-sql by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: How to choose table in SELECT clause without schema qualifier or 'set local'
Next
From: Bindra Bambharoliya
Date:
Subject: Cursor with hold for select takes too long