Re: Question about SELECT FOR UPDATE in transaction, isolation level
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Al <alexm@innocent.com>
Cc: pgsql-general@postgresql.org
Date: 2001-04-13T16:22:22Z
Lists: pgsql-general
Al <alexm%innocent.com@news.tht.net> writes: > begin work; > select val from ids where cntr='ct1' for update; > update ids set val=val+(some integer value) where cntr='ct1'; > commit work; Looks reasonable. > However, when I run everything except the commit on one terminal and > then run up to and including the select on another terminal, I receive > the OLD, non-updated value for val on that second terminal. In other > words, the select is not blocked and the id is not unique. Hm, it works for me. You sure you remembered to use select FOR UPDATE in both transactions? regards, tom lane