NT + deadlock intended behaviour ?

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: NT + deadlock intended behaviour ?
Date: 2004-07-17 23:06:39
Message-ID: 40F9B0FF.4060806@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,
I'm doing some experiments with NT, I din't expect this behaviuor:

create table test ( a integer );
insert into test values (3);
insert into test values (4);
insert into test values (5);
insert into test values (6);

SESSION 1; SESSION 2;

begin; begin;
update test set a = 300 where a = 3; update test set a = 40 where a = 4;
~ begin;
update test set a = 400 where a = 4;
<BLOCKED>
~ update test set a = 30 where a = 3;
~ <DEAD LOCK DETECTED>
~ commit;
<UNBLOCKED> <-- !?!?!
~ <here I'm able to do another commit>

why SESSION 1 was unblocked ? If I repeat again but I do an abort:

SESSION 1; SESSION 2;

begin; begin;
update test set a = 300 where a = 3; update test set a = 40 where a = 4;
~ begin;
update test set a = 400 where a = 4;
<BLOCKED>
~ update test set a = 30 where a = 3;
~ <DEAD LOCK DETECTED>
~ abort;
<STILL BLOCKED>

Why that commit unblock the SESSION 1?

Regards
Gaetano Mendola

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFA+bD+7UpzwH2SGd4RAq0VAJ9rZQ3aJmsJM6WSlLqIERJzDDS9iQCeL5rT
rF7PkCaJ59PWNQw4CK6uvug=
=Rb3s
-----END PGP SIGNATURE-----

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gaetano Mendola 2004-07-17 23:07:32 NT and aborted transaction
Previous Message Gaetano Mendola 2004-07-17 23:05:08 unused variable