On 2018/05/09 11:48 AM, Richard Hipp wrote:
On 5/9/18, Olivier Mascia <o...@integral.be> wrote:
"Column names in the expressions of a DO UPDATE refer to the original
unchanged value of the column, before the attempted INSERT. To use the value
that would have been inserted had the constraint not failed, add the special
"excluded." table qualifier to the column name."
Why using 'excluded' wording for this?
Because that is what PostgreSQL does. I also thought that "new" would
have been a better choice, but they didn't consult me. :-)
It is probable they considered confusion with precisely the Trigger
identifier we praise for its similarity.
On first read, "excluded" seemed unintuitive for me too, but the moment
I started thinking in terms of "these are the rows that won't be
included in the insert" (i.e. "The Excluded"), it quickly built a neural
pathway in the noggin and now seems completely normal. Just needed a
moment of acclimatization, as with any New thing. :)
sqlite-users mailing list