-
Notifications
You must be signed in to change notification settings - Fork 920
Closed
Description
If I have
WITH x AS (
SELECT * FROM table WHERE ...
)
UPDATE table
SET a = b
FROM x
When I run it, I get:
relation "x" does not exist
This is valid per Postgres: https://www.postgresql.org/docs/11/sql-update.html
A list of table expressions, allowing columns from other tables to appear in the WHERE condition and the update expressions. This is similar to the list of tables that can be specified in the FROM Clause of a SELECT statement. Note that the target table must not appear in the from_list, unless you intend a self-join (in which case it must appear with an alias in the from_list).
I tried to debug further but didn't have any luck.
Metadata
Metadata
Assignees
Labels
No labels