By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
select version();
version() |
---|
8.4.3 |
CREATE TABLE foo (id integer primary key, bar text);
INSERT INTO foo (id, bar) VALUES(1, 'text');
UPDATE foo SET bar = 'test' WHERE id IN (SELECT id FROM foo WHERE id = 1);
You can't specify target table 'foo' for update in FROM clause