Just interested, why below ( simplified ) example works this way.

CREATE TABLE test (id SERIAL, val INT NOT NULL, PRIMARY KEY(id));
INSERT INTO test (val) VALUES (1);

WITH t AS ( UPDATE test SET val = 1 RETURNING id ) 
DELETE FROM test WHERE id IN ( SELECT id FROM t);

Result:
DELETE 0

Question:
Why DELETE did not find any rows to delete?

PostgreSql version 9.2.1
Transaction isolation = read commited

Thanks!

Edit
Report