Al <alexm%innocent(dot)com(at)news(dot)tht(dot)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