Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ro9vR-00HQsF-ND for pgsql-sql@arkaria.postgresql.org; Sat, 23 Mar 2024 22:33:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ro9vP-00BEuP-Fe for pgsql-sql@arkaria.postgresql.org; Sat, 23 Mar 2024 22:33:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rnkvd-0078HW-On for pgsql-sql@lists.postgresql.org; Fri, 22 Mar 2024 19:51:50 +0000 Received: from mail-ua1-x936.google.com ([2607:f8b0:4864:20::936]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rnkvY-005uMG-TF for pgsql-sql@lists.postgresql.org; Fri, 22 Mar 2024 19:51:48 +0000 Received: by mail-ua1-x936.google.com with SMTP id a1e0cc1a2514c-7e05b1ef7caso1197591241.2 for ; Fri, 22 Mar 2024 12:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711137105; x=1711741905; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6Z4KeBbth04cr/e43mgctuGmez8iSPYZxg89PTC75f4=; b=XewqU/WYfXBiXPYBm1sxq+4b+nZjj1v+KwA5ydHx0DcLjPVEHdkvlregytNSHMlIJ9 etRdVJLof0jJLvEiKIX5jm1rMojAPOoJSkL3CylUZrMr/Cu1gmp+Oi7hFYNoXi8aOYEw aPuqid9hSt7X3WpiClWlIlb5bAnG8RuvCMMA7sgfiLzckTYwt8jbH/3lTa/XqZn9G+KP USKKb0801e3DtUMJR2PxzTsrii2pkoEbM+D/8i7Ofy6K3oh5EFZhugVuuZ7EWOvvF4c5 O+OrWzY6xl/mXpa68lP0aNO6UlQsgDnT+2VyhvDdZEMO+q9OdFAUAFC2eNIGKQExQ11N bB0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711137105; x=1711741905; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6Z4KeBbth04cr/e43mgctuGmez8iSPYZxg89PTC75f4=; b=LvZ/hT4NfSJ9TazkCPRfCX/FNU02iY1URH5ttkFU5NVTkuWyOJ+k+NvZwBh7rDek5v OUtU0ypbFg3bsHNVwy4n7WoL2083DpNG21wpo/3iOrB2ASHL0VyTIIFKARJcr0scLIXS 08X77/rQubzIySJYZLaXvl9YZu3bo7vMQKB+efyQ1X851KcNp4MCh8bc5tfVkuS4lmTz 4E6g9NPxcWPyid8fFRmFfpmtLbnouceSOT9RNJ9YgcSZdEyZsgQWx8pEnfVKehIdVQu3 ucs6Xz1yz0jm+tugl9DYYz3NeJCFcfyNf5EXMN8Fb7LIQt7LL+jo1JxO8GJGk7ReQ3ab YJWg== X-Gm-Message-State: AOJu0YwivjNp6QctdRxrMKZbzjK338KuXAEOhFfX5uRYhuPVi0r8fEaT Gqm8fUMfrzehq4OwFTR5Vakh+gf8yXfDRhOdWyI67X0WfwqsZsteiJHJnQ8ZseoVV1ZbQ+uTuP5 h3Jhvxzzf62P39yxjoWuTfQgMu0PuItFp X-Google-Smtp-Source: AGHT+IGswz6Y0svAHHfzfUCHWMmkYixT8OO5aLuKySz/cKdju+8gk7rZumSwsYmP1NvZxBo2swNZCs9rSSCmTK9UrOs= X-Received: by 2002:a05:6102:c86:b0:472:d0ef:255b with SMTP id f6-20020a0561020c8600b00472d0ef255bmr879289vst.10.1711137105048; Fri, 22 Mar 2024 12:51:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jamie Thompson Date: Fri, 22 Mar 2024 19:51:33 +0000 Message-ID: Subject: Re: UPDATE with AND clarification To: "David G. Johnston" Cc: pgsql-sql@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000004efe8406144527b0" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004efe8406144527b0 Content-Type: text/plain; charset="UTF-8" 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, wrote: > On Friday, March 22, 2024, Jamie Thompson > 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. > > --0000000000004efe8406144527b0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Yes they were both boolean columns.

It felt odd at the time, but yes it makes sens= e.

Thank you.



On Fri, 22 Mar 2024, 13:35 David G. Johnston, <= david.g.johnston@gmail.com> wrote:
On Friday, March 22, 2= 024, Jamie Thompson <jthompson.neuk@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">

Earlier today, I was running s= ome sql for someone which they had submitted as:
> UPDATE=C2=A0tablen= ame SET col1 =3D val1 AND col2 =3D val2 WHERE id =3D X

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

Which in this case must coin= cidentally have produced whatever boolean value already existed in col1.

David J.

--0000000000004efe8406144527b0--