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.

It could mean that, when accessing the target relation, the condition
can only refer to system attributes, not user-defined attributes,
which certainly isn't true.

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.

Or it could be trying to document an exception to the previous
sentence -- a condition on a WHEN NOT MATCHED clause can't refer to
attributes of the target row, since there is no target row, but an
exception is made for system attributes. But that isn't true either --
there is no such exception.

So I propose simply deleting that sentence.

Regards,
Dean

Attachment: v1-0001-doc-Remove-incorrect-sentence-from-MERGE-docs-for.patch.no-cfbot
Description: Binary data

Reply via email to