Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT
Дата
Msg-id CAH2-Wz=O1=_DCzPCLtjgnh6n=Lwsr-vVv4Ddhd7sQ4yiYgPKHw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: doc: Clarify what "excluded" represents for INSERT ON CONFLICT  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Thu, Jun 30, 2022 at 3:07 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:
> Yes, and based on a single encounter I agree this doesn't seem like a broadly encountered issue.  My takeaway from
thateventually led to this proposal.  The "Other Person" who is complaining about the docs is one of the mentors on the
Discordserver and works for one of the corporate contributors to the community. (I suppose Discord is considered public
somaybe 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)
Следующее
От: Jacob Champion
Дата:
Сообщение: Re: [PATCH] minor reloption regression tests improvement