Skip site navigation (1) Skip section navigation (2)

Bug #846: Oncurrent transactions about select for update

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #846: Oncurrent transactions about select for update
Date: 2002-12-12 08:27:05
Message-ID: 20021212082705.1300E475DC0@postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
zeng yubo (yubo(dot)zeng(at)ezcross(dot)com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
Oncurrent transactions about select for update

Long Description
   Two concurrent transactions control by "select for update", they can shared the data with insert ?
   

Sample Code
The table Name is num_center .
select count(*) from  num_center ;
we support the result execute is 100.

--(1) first , transaction A exceute:
begin work;
select * from num_center where type='lock_row' for update ;
insert into num_center( type , currval ) values ('test1',100);

--(2) then Transaction B exceute:
begin work;
select * from num_center where type='lock_row' for update ;
select count(*) from  num_center ;

--(3) Transaction A exceute:
commit;

--(4) Transaction B exceute:
commit;
--the Transaction B Result is  100 .

why not be : 100 + 1 = 101 ?
  

No file was uploaded with this report


pgsql-bugs by date

Next:From: Ocke JanssenDate: 2002-12-12 14:06:36
Subject: OpenOffice loops calling SQLForeignKeys
Previous:From: Bruce MomjianDate: 2002-12-12 05:36:38
Subject: Re: Bug #838: SSL problems in 7.3

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group