Re: Problem with SELECT FOR UPDATE NOWAIT

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: Problem with SELECT FOR UPDATE NOWAIT
Дата
Msg-id 20060420224737.GP49405@pervasive.com
обсуждение исходный текст
Ответ на Problem with SELECT FOR UPDATE NOWAIT  ("Mathias Laurent" <e1lauren@hotmail.com>)
Список pgsql-admin
I think you're confused about what actually happened...

Session 1:
decibel=# select * from a;
 i
---
 1
(1 row)

decibel=# begin;
BEGIN
decibel=# select * from a for update nowait;
 i
---
 1
(1 row)

decibel=#

Session 2:
decibel=# select * from a for update nowait;
ERROR:  could not obtain lock on row in relation "a"
decibel=# select * from a for update;

...waits...

Session 1:
decibel=# rollback;
ROLLBACK
decibel=#

And immediately in session 2:
 i
---
 1
(1 row)

decibel=#

On Thu, Apr 13, 2006 at 01:57:47AM +0000, Mathias Laurent wrote:
> Hello,
>
> Veiled I have a small problem which I have solved in a way not very clean,
> I would thus like to have your opinion. When I made with the process 1 :
>
> Select * FROM myTable WHERE num=3 FOR UPDATE NOWAIT
>
> And that I remade it with a process 2 before having do one "Commit" It
> blocked me (until there normal)
> But once that I free by doing one "Commit" with process 1 All the table
> remains to block for process 2...
> To have access it, it is necessary that I do one "Commit" with the
> processus2 !! It's very strange...
>
> Thank you,
>
> Mathias Laurent
>
> _________________________________________________________________
> Windows Live Mail : d?couvrez et testez la version b?ta !
> http://www.ideas.live.com/
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>               http://www.postgresql.org/docs/faq
>

--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: WAL file naming after postmaster restart
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: what the problem with this query