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

From PG Doc comments form
Subject https://www.postgresql.org/docs/current/sql-insert.html
Date
Msg-id 173054051344.697.17098388380226931495@wrigleys.postgresql.org
Whole thread Raw
Responses Re: https://www.postgresql.org/docs/current/sql-insert.html
List 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 by date:

Previous
From: Marcelo Fernandes
Date:
Subject: RE: Tip box on Adding a Column
Next
From: jian he
Date:
Subject: Re: Tip box on Adding a Column