Re: Behavior of ON DELETE CASCADE in CTEs - Mailing list pgsql-docs

From David G. Johnston
Subject Re: Behavior of ON DELETE CASCADE in CTEs
Date
Msg-id CAKFQuwbr=xhxaDYekUSbpCcyTe_Xak2BTw9TpoaW6S95n+iO_g@mail.gmail.com
Whole thread Raw
In response to Behavior of ON DELETE CASCADE in CTEs  (Kirk Parker <khp@equatoria.us>)
Responses Re: Behavior of ON DELETE CASCADE in CTEs
List pgsql-docs
On Wednesday, September 4, 2024, Kirk Parker <khp@equatoria.us> wrote:

And the relevance to this current list is: if it IS intended behavior, can it be documented somewhere?

It’s follows from this paragraph:


The sub-statements in WITH are executed concurrently with each other and with the main query. Therefore, when using data-modifying statements in WITH, the order in which the specified updates actually happen is unpredictable. All the statements are executed with the same snapshot (see Chapter 13), so they cannot see one another's effects on the target tables. This alleviates the effects of the unpredictability of the actual order of row updates, and means that RETURNING data is the only way to communicate changes between different WITH sub-statements and the main query.

David J.

pgsql-docs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Behavior of ON DELETE CASCADE in CTEs
Next
From: Kirk Parker
Date:
Subject: Re: Behavior of ON DELETE CASCADE in CTEs