On Thu, Jun 30, 2022 at 3:07 PM David G. Johnston <david.g.johns...@gmail.com> wrote: > Yes, and based on a single encounter I agree this doesn't seem like a broadly > encountered issue. My takeaway from that eventually led to this proposal. > The "Other Person" who is complaining about the docs is one of the mentors on > the Discord server and works for one of the corporate contributors to the > community. (I suppose Discord is considered public so maybe this redaction is > unnecessary...)
My impression from reading this transcript is that the user was confused as to why they needed to qualify the target table name in the ON CONFLICT DO UPDATE's WHERE clause -- they didn't have to qualify it in the targetlist that appears in "SET ... ", so why the need to do it in the WHERE clause? This isn't something that upsert statements need to do all that often, just because adding additional conditions to the WHERE clause isn't usually necessary. That much makes sense to me -- I *can* imagine how that could cause confusion. If that interpretation is correct, then it's not clear what it should mean for how the INSERT documentation describes EXCLUDED. EXCLUDED is involved here, since EXCLUDED is the thing that creates the ambiguity, but that seems almost incidental to me. This user would probably not have been confused if they didn't need to use a WHERE clause (very much the common case), even when expression evaluation involving EXCLUDED in the SET was still used (also common). -- Peter Geoghegan