On PG, test Update_with_cross_apply_set_constant produces the following SQL:
UPDATE "Customers" AS c
SET "ContactName" = 'Updated'
FROM (
SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."OrderDate"
FROM "Orders" AS o
WHERE o."OrderID" < 10300 AND date_part('year', o."OrderDate")::int < length(c."ContactName")::int
) AS t
WHERE c."CustomerID" LIKE 'F%'
This fails with the following, since c.ContactName references an outer column:
ERROR: invalid reference to FROM-clause entry for table "c" at character 240
HINT: There is an entry for table "c", but it cannot be referenced from this part of the query.
Originally discussed in npgsql/efcore.pg#2475 (comment)
On PG, test Update_with_cross_apply_set_constant produces the following SQL:
This fails with the following, since c.ContactName references an outer column:
Originally discussed in npgsql/efcore.pg#2475 (comment)