With statements does not modify original table untill it is "complete"

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: pulk(dot)hesten(at)gmail(dot)com
Subject: With statements does not modify original table untill it is "complete"
Date: 2019-02-27 06:43:02
Message-ID: 155124978232.1372.5464135554084765467@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/11/queries-with.html
Description:

I think it should be more more visible that data does not change in the
table, untill the with statement is complete. It took some trial-and-error
and fine-reading of the manual before I got this part.

My test code was as following:

create table test(id bigint);
insert into test(id) VALUES(1), (2), (3), (4);
with del as
(delete from test where id in (1, 2))
select * from test;
id
----
1
2
3
4
(4 rows)

Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2019-03-01 05:58:21 Error in 9.6 documentation? checkpoint_flush_after
Previous Message Euler Taveira 2019-02-25 14:37:32 Re: FORMAT keyword not allowed in COPY ... FROM statement