Re: Changing the transaction isolation level within the stored - Mailing list pgsql-sql

From Andrew Sullivan
Subject Re: Changing the transaction isolation level within the stored
Date
Msg-id 20060126113902.GB3995@phlogiston.dyndns.org
Whole thread Raw
In response to Re: Changing the transaction isolation level within the stored  (Markus Schaber <schabi@logix-tt.com>)
Responses Re: Changing the transaction isolation level within the stored  (Markus Schaber <schabi@logix-tt.com>)
List pgsql-sql
On Thu, Jan 26, 2006 at 10:42:54AM +0100, Markus Schaber wrote:

> AFAIK, in PostgreSQL normal SQL commands cannot create deadlocks at all,
> the only way to introduce deadlocks is to issue LOCK commands to take
> locks manually. And for this rare case, PostgreSQL contains a deadlock
> detection routine that will abort one of the insulting transactions, and
> the others can proceed.

You can too.  Consider this:

t1                                        t2

BEGIN;                                    BEGIN;
UPDATE table1 SET col1=                   UPDATE table2 SET col1=    col1+5;                                  (SELECT
col3FROM
 
DELETE FROM table2 WHERE                          table3);col1 = col1+6;                    UPDATE table1 SET col1 =
                                col1 +5;
 
COMMIT;                                   COMMIT;

Suppose these are concurrent.  The problem here is that each
transaction need something in the other transaction either to
complete or rollback before the work can proceed.  So one of them has
to lose.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
This work was visionary and imaginative, and goes to show that visionary
and imaginative work need not end up well.     --Dennis Ritchie


pgsql-sql by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: filtering after join
Next
From: "A. Kretschmer"
Date:
Subject: question with times and intervals