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

Bug #722: SELECT FOR UPDATE bug

From: paviles(at)its(dot)co(dot)cr
To: tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-bugs(at)postgresql(dot)org
Subject: Bug #722: SELECT FOR UPDATE bug
Date: 2002-07-27 05:09:55
Message-ID: OF3C9258F8.63F97B74-ON06256C03.005F7479-06256C03.005FA0C7@its.co.cr (view raw or flat)
Thread:
Lists: pgsql-bugs
Pablo Aviles
27/07/2002 10:58


        To:     Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
        cc: 
        Subject:        Re: [BUGS] Bug #722: SELECT FOR UPDATE bug

 
 Hi,
we are use Postgresql 7.3.
The case in questions is: we have many clients (pc's) of postgresql. Every 
client try to block an employee to display at user. The user make change 
in the employee, but nobody can take the same employee at same time. 
Before changes, the next step is update the record (Record blocked)

But, when I use 
>   SELECT * FROM employees 
>   WHERE status = 'A' 
>   LIMIT 1 
>   FOR UPDATE; 
to catch the employee, only the first user select a record. Other users 
can`t select any employee until the first user release the record. The 
first conclusion here, is that Postgresql block all employee table.
When we try to use the LOCK sentence, the result don´t have change.

regards, 
Pablo Avilés Cisneros
Technology, ITS 
Software Development Area
Technology, ITS 
San José, Costa Rica
email: paviles(at)its(dot)co(dot)cr
 
 




Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
27/07/2002 09:58

 
        To:     paviles(at)its(dot)co(dot)cr, pgsql-bugs(at)postgresql(dot)org
        cc: 
        Subject:        Re: [BUGS] Bug #722: SELECT FOR UPDATE bug


pgsql-bugs(at)postgresql(dot)org writes:
>   SELECT * FROM employees 
>   WHERE status = 'A' 
>   LIMIT 1 
>   FOR UPDATE; 

> The problem, in the previous sentence, is block every record on
> employees, although we want one record, we want limit 1.

I do not believe that.  Could you give a more complete example of
your problem?

It would also help if you'd state which Postgres version you're using.

                                                 regards, tom lane



Responses

pgsql-bugs by date

Next:From: Richard SoDate: 2002-07-27 06:45:41
Subject: Multi-byte character bug
Previous:From: pgsql-bugsDate: 2002-07-27 01:36:07
Subject: Bug #722: SELECT FOR UPDATE bug

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