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

From Jamie Thompson
Subject Re: UPDATE with AND clarification
Date
Msg-id CABoe=cTes2i9vStJCi3SMecrWHKw9_aFjFRhfa_KtDu-nSqKXQ@mail.gmail.com
Whole thread Raw
In response to Re: UPDATE with AND clarification  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-sql
Yes they were both boolean columns.

It felt odd at the time, but yes it makes sense.

Thank you.



On Fri, 22 Mar 2024, 13:35 David G. Johnston, <david.g.johnston@gmail.com> wrote:
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: Tom Lane
Date:
Subject: Re: Cursor with hold for select takes too long
Next
From: ft
Date:
Subject: decode/encode backslash to base64