Re: Joins of data-modifying CTE with the target table

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Joins of data-modifying CTE with the target table
Дата
Msg-id e8ad8aca-c0e4-65f8-e51c-fde543db62fa@aklaver.com
обсуждение исходный текст
Ответ на Re: Joins of data-modifying CTE with the target table  (Alex Bolenok <quassnoi@gmail.com>)
Список pgsql-general
On 4/19/23 09:09, Alex Bolenok wrote:
> To reiterate, I (I personally) get why it's not working, but the 
> documentation is something that is intended for people who don't.
> 
> Technically, anyone can deduce it from reading the documentation 
> thoroughly enough, but do we need the documentation to be as terse 
> as possible?

Not so much terse as possible as not as verbose as possible. The 
difference being that documenting every possible usage would turn the 
page into an eye glazing experience. At that point folks would really 
just move on. The documentation expectations(as I see it) are that: 1) 
People can work from basic principles to specific usage. 2) They also 
actually test/verify what they run.

What you are after is more on the lines of a separate enhanced tutorial. 
That has been discussed on this list and elsewhere. So far it has not 
progressed beyond discussion.


> 
> To answer your question, by "explicitly" I mean mentioning this very 
> pattern, where you join the returned id with the target table. People 
> often try to use this pattern for queries like "add an item to the order 
> in a CTE, select the order total in the main query", and often don't 
> notice that the order total doesn't include the new item until it hits 
> production.
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com




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

Предыдущее
От: Alex Bolenok
Дата:
Сообщение: Re: Joins of data-modifying CTE with the target table
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Joins of data-modifying CTE with the target table