Re: UPDATE with AND clarification

From: Jamie Thompson <jthompson(dot)neuk(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Re: UPDATE with AND clarification
Date: 2024-03-22 19:51:33
Message-ID: CABoe=cTes2i9vStJCi3SMecrWHKw9_aFjFRhfa_KtDu-nSqKXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)g(dot)johnston(at)gmail(dot)com>
wrote:

> On Friday, March 22, 2024, Jamie Thompson <jthompson(dot)neuk(at)gmail(dot)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.
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message ft 2024-03-24 21:29:39 decode/encode backslash to base64
Previous Message Tom Lane 2024-03-22 17:57:33 Re: Cursor with hold for select takes too long