Re: Different results between PostgreSQL and Oracle for "for update" statement - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Different results between PostgreSQL and Oracle for "for update" statement
Date
Msg-id 1052083.1605800985@sss.pgh.pa.us
Whole thread Raw
In response to Different results between PostgreSQL and Oracle for "for update" statement  (Andy Fan <zhihui.fan1213@gmail.com>)
Responses Re: Different results between PostgreSQL and Oracle for "for update" statement  (Andy Fan <zhihui.fan1213@gmail.com>)
List pgsql-hackers
Andy Fan <zhihui.fan1213@gmail.com> writes:
> create table su (a int, b int);
> insert into su values(1, 1);

> - session 1:
> begin;
> update su set b = 2 where b = 1;

> - sess 2:
> select * from su where a in (select a from su where b = 1) for update;

This'd probably work the way you expect if there were "for update"
in the sub-select as well.  As is, the sub-select will happily
return "1".

            regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Skip ExecCheckRTPerms in CTAS with no data
Next
From: Pavel Borisov
Date:
Subject: Re: BUG #16663: DROP INDEX did not free up disk space: idle connection hold file marked as deleted