I'm moving this to GENERAL. Whomsoever replies there please delete the
pgsql-hackers cc entry.
On Thu, 5 Jun 2003, Rasmus Resen Amossen wrote:
> Does Postgres garantee repeatable-read (RR) during transactions? And does it
> implement ARIES/KVL?
>
> If so, why is the following possible?
>
> T1: begin;
> T1: select * from table;
> (notice the row with id = X)
> T2: begin;
> T2: delete from table where id = X;
> T1: select * from table;
> (notice the row with id = X suddenly is gone)
What version of postgresql are you running?
Did you NOT commit the T2 transaction before the last select for T1?
If you commit the deletion, and do NOT have transaction mode set to
serializable, then yes, this is what you'll see.
You can either use select for update or serializable transactions.