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

Re: Locking tables

From: Dmitry Tkach <dmitry(at)openratings(dot)com>
To: Markus Bertheau <twanger(at)bluetwanger(dot)de>
Cc: Allan Berger <alb2(at)cornell(dot)edu>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Locking tables
Date: 2003-07-22 22:02:51
Message-ID: 3F1DB48B.8090105@openratings.com (view raw or flat)
Thread:
Lists: pgsql-novice
Markus Bertheau wrote:

>В Пнд, 21.07.2003, в 20:03, Dmitry Tkach пишет:
>
>  
>
>>select * from table where id=1 FOR UPDATE;
>>
>>... is what you are looking for - this will put a lock on the rows that 
>>actually get selected, so that another transaction will not be able to 
>>modify them until you commit or rollback.
>>    
>>
>
>Can new rows be inserted by another connection with id = 1?
>
>  
>
Yes, unless you have a unique constraint (or primary key) on that table 
for the id (if you do, then attempts to insert another row with the same 
id will fail)...

Dima

P.S. Your name doesn't look Russian to me... How come you seem to be 
using a Russian email client? :-)


In response to

Responses

pgsql-novice by date

Next:From: Markus BertheauDate: 2003-07-23 06:00:29
Subject: Re: Locking tables
Previous:From: Markus BertheauDate: 2003-07-22 21:38:57
Subject: Re: Locking tables

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