On 2026-Nov-23, Dean Rasheed wrote: > BTW, while looking at this, I noticed that the docs for the > "condition" expression that can appear after MERGE ... WHEN ... AND > currently say: > > A condition on a WHEN MATCHED clause can refer to columns in both the > source and the target relations. A condition on a WHEN NOT MATCHED BY > SOURCE clause can only refer to columns from the target relation, since > by definition there is no matching source row. A condition on a WHEN > NOT MATCHED [BY TARGET] clause can only refer to columns from the source > relation, since by definition there is no matching target row. Only the > system attributes from the target table are accessible. > > That last sentence has existed since MERGE was added and it seems wrong to me. > > In fact, I find that sentence hard to interpret -- there are multiple > possible interpretations, none of which seem to be true.
Yeah ... > Or it could mean that system attributes from the target table are > accessible, but system attributes from the source are not. That may > have been true at some point during the development of the MERGE > feature, but it's not true now -- if the source is a base table, its > system attributes are accessible. I think this is the correct interpretation. > So I propose simply deleting that sentence. +1, please do. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "I can see support will not be a problem. 10 out of 10." (Simon Wittber) (http://archives.postgresql.org/pgsql-general/2004-12/msg00159.php)
