Row Locking
От | Alexander Klayman |
---|---|
Тема | Row Locking |
Дата | |
Msg-id | 200205192353.23312.aklayman@mindspring.com обсуждение исходный текст |
Ответы |
Re: Row Locking
|
Список | pgsql-general |
I have a few basic question and either need an affirmation or correction. Thank you very much for help in advance. When using Row locks, when does the lock start, which rows does it lock and when does it end? I was unable to find this info in documentation (maybe because it is supposed to be implicit). I have the following idea: BEGIN; LOCK TABLE A IN ROW EXCLUSIVE MODE; SELECT c FROM A WHERE id=1; # The row with d=1 is locked if c then DELETE FROM A WHEE id=1; COMMIT; # The row (if remaining) is unlocked Also, could I do something like this: BEGIN; LOCK TABLE A IN ROW EXCLUSIVE MODE; cursor = SELECT c, id FROM A WHERE d=1; while cursor.fetchone() # Next row is locked, previous row if c then # (if remaining) is unlocked DELETE FROM A WHERE id=id; COMMIT; Thanks.
В списке pgsql-general по дате отправления: