Re: Behavior of ON DELETE CASCADE in CTEs

From: Kirk Parker <khp(at)equatoria(dot)us>
To: "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Behavior of ON DELETE CASCADE in CTEs
Date: 2024-09-05 02:46:35
Message-ID: CANwZ8rmVM4GzJFGW866TR34qtaKmQqFRnHdzN3E02bG2ta89kw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

> The sub-statements in WITH are executed concurrently

That much I did get from the docs. Given each sub-statement is qualified
by the RETURNING results of the previous one, that should at least
guarantee the completeness of each query regardless of the order in which
individual rows are affected.

Thanks, this has been helpful -- as I reread the page you pointed to, this
jumped out at me:

> All the statements are executed with the same *snapshot* (see
Chapter 13 <https://www.postgresql.org/docs/current/mvcc.html>), so they
cannot “see” one another's effects on the target tables.

That I think specifically covers my question, and Tom Lane's note about
end-of-statement was also helpful.

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Alain Bourgeois 2024-09-05 09:24:50 RE: pg_upgrade -c cannot be run if old cluster is running
Previous Message David G. Johnston 2024-09-05 01:40:31 Re: Behavior of ON DELETE CASCADE in CTEs