| От | Tom Lane |
|---|---|
| Тема | Re: Joins of data-modifying CTE with the target table |
| Дата | |
| Msg-id | 2991189.1681923194@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Joins of data-modifying CTE with the target table (Alex Bolenok <quassnoi@gmail.com>) |
| Список | pgsql-general |
Alex Bolenok <quassnoi@gmail.com> writes:
> To answer your question, by "explicitly" I mean mentioning this very
> pattern, where you join the returned id with the target table.
I do not see why this existing example isn't sufficient:
... An example of this is that in
WITH t AS (
UPDATE products SET price = price * 1.05
RETURNING *
)
SELECT * FROM products;
the outer SELECT would return the original prices before the action of
the UPDATE, ...
Yeah, it lacks a JOIN and it's an UPDATE not an INSERT. But we can't
provide an example to precisely match every possible mistake. As
Adrian said, brevity in the docs does have value.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера