Re: Joins of data-modifying CTE with the target table

2023-04-19 Thread Alex Bolenok
notice that the order total doesn't include the new item until it hits production. ср, 19 апр. 2023 г. в 11:46, Tom Lane : > Alex Bolenok writes: > > I get why it's not working (because the statement is not allowed to see > the > > tuples with its own cmin), but I

Joins of data-modifying CTE with the target table

2023-04-19 Thread Alex Bolenok
Hi list, This popped up yesterday during a discussion at the Boston PostgreSQL group meetup, and Jesper Pedersen had advised that I post it here. Imagine this setup: CREATE TABLE IF NOT EXISTS mytable (id BIGSERIAL PRIMARY KEY, value TEXT NOT NULL); WITHinsert_cte AS ( INSER