https://www.postgresql.org/docs/current/sql-insert.html

Поиск
Список
Период
Сортировка
От PG Doc comments form
Тема https://www.postgresql.org/docs/current/sql-insert.html
Дата
Msg-id 173054051344.697.17098388380226931495@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: https://www.postgresql.org/docs/current/sql-insert.html
Список pgsql-docs
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/17/sql-insert.html
Description:

Hi,
the example found in the doc above:

WITH upd AS (
  UPDATE employees SET sales_count = sales_count + 1 WHERE id =
    (SELECT sales_person FROM accounts WHERE name = 'Acme Corporation')
    RETURNING *
)
INSERT INTO employees_log SELECT *, current_timestamp FROM upd;

might result into UPDATE 0 / INSERT 0 because the documentation regarding
the CTE states: "The sub-statements in WITH are executed concurrently with
each other and with the main query".
The subquery SELECT sales_person FROM accounts WHERE name = 'Acme
Corporation' might not be waited on by the UPDATE query resulting into an
UPDATE 0.
Is my suspicion valid?

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