Обсуждение: With statements does not modify original table untill it is "complete"

Поиск
Список
Период
Сортировка

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

От
PG Doc comments form
Дата:
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)