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 1saxOR-00CX5e-Ec for pgsql-general@arkaria.postgresql.org; Mon, 05 Aug 2024 13:04:55 +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 1saxOP-00DhU8-Tf for pgsql-general@arkaria.postgresql.org; Mon, 05 Aug 2024 13:04:53 +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 1saxOP-00DhTz-I7 for pgsql-general@lists.postgresql.org; Mon, 05 Aug 2024 13:04:53 +0000 Received: from mail-oo1-xc2f.google.com ([2607:f8b0:4864:20::c2f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1saxOM-003Ddq-Kv for pgsql-general@lists.postgresql.org; Mon, 05 Aug 2024 13:04:52 +0000 Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-5d5c2ac3410so6004313eaf.2 for ; Mon, 05 Aug 2024 06:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722863090; x=1723467890; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=j9phfEWeIQKRXZA/Lh3JKMvWuR5OLwgVmROs/5Ayhk4=; b=SRVqzLwlME3A4o4s3ZjbNxzWiaT/DrC721Mk15ba452OBNz1CGOMZQJeIZVCs14rXP ePJ3CZKocrLBeBbG7d727jiXIsqDPizqrVxvYleSs3fPHzkH58Mva+qwn4hy4N7JH0fk /YIBp5k8nroevMBCklLxDynLw4GZ3cw5nxgg/pjxrSJtAnuPCuC97PRWQo3Ligz/UnfC FkCYtgpO5AI5Ki76gyTeuJxJ4EIuZlFlg2vSJAglrQFw7LP4Hc4/JANVrjew0B14YlwU TUv8CU/ZkX2dYYttWvjGnFVEZcIrSyHFbeyR3FVbHtUftk/JqryR6zuL9PLAwMyOsKsF 3m2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722863090; x=1723467890; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=j9phfEWeIQKRXZA/Lh3JKMvWuR5OLwgVmROs/5Ayhk4=; b=hpD7FKbBn1HQrkXyopYI9GDia+KgitIKP9SwkTzuaeAcDMokd+J/IckME9tBCosP6l varW13T2KH/te+9AX6rMCQF9JTAp+DFjnjJ/pexo6k4XQgLUODk7QnqDLsNf0kh1uYEy 0xkMSTMNNe6x962RKzr7V03SU4eb67PpRior5tHZJTegzgOiTKIGvqYwYLjFfYRFY/e4 47A9bOdHT/MGaoO33EO+0Bf0VgvYOWp2lxt2GCT6gKt7RaNlt6edUtP6ansCV9azvCvg g/sB3wlVi+lb4bFkzT+N0XAVlglNITygk+Rg9J7TxcAF/G8nyqen226R/8Xwn82LoGYr rhcw== X-Gm-Message-State: AOJu0YyTd5mZgUSbmYUkzckSSst9eSZvYjQhLfdNVDNcCRcIGf2UG9F1 nFOzCnU/A7kfn+yj/iMBmqXETSACIzCxqxqKA5xv9xiEwGqSIYE2O+cPqXz8W5r/iQYnydprBOa rGLWDmx2PQ1YXTANVw+64uXMB3sU= X-Google-Smtp-Source: AGHT+IFP30sJEwzHhkUuYAbcyX2kKASh483Djbc+Moo6dkIF/ZZDMnlhU9we4XiEWod3I6QcKvMUjbXCTUMkl3Naxf4= X-Received: by 2002:a05:6871:3325:b0:261:218:dae with SMTP id 586e51a60fabf-26891ea8f86mr15675252fac.33.1722863089089; Mon, 05 Aug 2024 06:04:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:6c93:0:b0:557:c384:fb61 with HTTP; Mon, 5 Aug 2024 06:04:48 -0700 (PDT) In-Reply-To: References: From: "David G. Johnston" Date: Mon, 5 Aug 2024 06:04:48 -0700 Message-ID: Subject: Re: UPDATE-FROM and INNER-JOIN To: Dominique Devienne Cc: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000006c0da0061eef52c1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000006c0da0061eef52c1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Monday, August 5, 2024, Dominique Devienne wrote: > In https://sqlite.org/forum/forumpost/df23d80682 > Richard Hipp (Mr SQLite) shows an example of something > that used to be supported by SQLite, but then wasn't, to be > compatible with PostgreSQL. > > Thus I'm curious as to why PostgreSQL refuses the first formulation. > Could anyone provide any insights? Thanks, --DD > Interesting=E2=80=A6but not too surprising. The joining condition between = the update relation and the from relation needs to be done in the where clause. You cannot reference columns of the update relation in the from clause because the update relation is not named in the from clause. There is still an underlying =E2=80=9Cwhy=E2=80=9D here that I don=E2=80=99= t know=E2=80=A6 David J. --0000000000006c0da0061eef52c1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Monday, August 5, 2024, Dominique Devienne <ddevienne@gmail.com> wrote:
In https://sqlite.org/forum/forumpost/df23d80682
Richard Hipp (Mr SQLite) shows an example of something
that used to be supported by SQLite, but then wasn't, to be
compatible with PostgreSQL.

Thus I'm curious as to why PostgreSQL refuses the first formulation. Could anyone provide any insights? Thanks, --DD

Interesting=E2=80=A6but not too surprising= .=C2=A0 The joining condition between the update relation and the from rela= tion needs to be done in the where clause.=C2=A0 You cannot reference colum= ns of the update relation in the from clause because the update relation is= not named in the from clause.

There is still an u= nderlying =E2=80=9Cwhy=E2=80=9D here that I don=E2=80=99t know=E2=80=A6

David J.

--0000000000006c0da0061eef52c1--