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

Re: Select For Update bug???

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: paviles(at)its(dot)co(dot)cr
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Select For Update bug???
Date: 2002-07-30 02:52:57
Message-ID: 200207300252.g6U2qvC21424@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
What PostgreSQL version are you using?  Please try this in two psql
sessions and see if you see the same thing.

---------------------------------------------------------------------------

paviles(at)its(dot)co(dot)cr wrote:
> Hi, I'm encountered a problem with a select for update sentence with 
> postgresql.
> 
> If I use...:
> begin transaction;
> 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. The bug it seems the limit 
> 1, because if I dispose the limit 1 line, only the return records are 
> blocked.
> 
> If I use:
> begin transaction;
> select * from employees
> where  (status = 1) and (id_employee = 123)
> order by id_employee
> for update;
> ...
> it block every record on employees, although we want one record, we want 
> id_employee = 123. The bug it seems the order by line, because if I 
> dispose the order by line, only the return records are blocked.
> 
> Do you have an alternative way? Is this a bug? Any suggestion?
> 
> I'm using Delphi 6 with dbexpress, and the transaction was make with an 
> TSQLClientDataSet component after an TSQLConnection
> 
>  
> Pablo Avil?s Cisneros
> Technology, ITS 
> Software Development Area
> Technology, ITS 
> San Jos?, Costa Rica
> email: paviles(at)its(dot)co(dot)cr
>  
>  

[ image/gif is not supported, skipping... ]

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2002-07-30 04:35:31
Subject: Re: Money locale currency symbol position
Previous:From: Marko MikulicicDate: 2002-07-29 16:11:36
Subject: Re: Money locale currency symbol position

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