Re: UPDATE-FROM and INNER-JOIN - Mailing list pgsql-general

From David G. Johnston
Subject Re: UPDATE-FROM and INNER-JOIN
Date
Msg-id CAKFQuwYcFGgS9itAqsUj5Y02UtDXr8yBtac9w+v+45pLEu4U3Q@mail.gmail.com
Whole thread Raw
In response to UPDATE-FROM and INNER-JOIN  (Dominique Devienne <ddevienne@gmail.com>)
List pgsql-general
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…but 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 “why” here that I don’t know…

David J.

pgsql-general by date:

Previous
From: David Rowley
Date:
Subject: Re: Building v17 Beta2 on Windows
Next
From: Tom Lane
Date:
Subject: Re: UPDATE-FROM and INNER-JOIN