From: | Vadim Mikheev <vadim(at)krs(dot)ru> |
---|---|
To: | "Dr(dot) Michael Meskes" <meskes(at)online-club(dot)de> |
Cc: | "'hackers(at)postgresql(dot)org'" <hackers(at)postgreSQL(dot)org> |
Subject: | Re: [HACKERS] Re: Dropping tables... |
Date: | 1998-08-03 05:58:51 |
Message-ID: | 35C5519B.CF305216@krs.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Thanks again, Michael!
> > 1. In session T1 run
> >
> > LOCK TABLE test IN EXCLUSIVE MODE;
> >
> > 2. In session T2 run
> >
> > UPDATE test SET y = 0 WHERE x = 0;
> >
> > -- shouldn't be blocked by T1 if ROW EXCLUSIVE
> > -- lock is acquired by T2 only when row found
>
> But it indeed is blocked.
Ok, I misunderstood Oracle documentation..
Blocking means that T2 acquires ROW EXCLUSIVE table lock
_before_ statement execution.
>
> > 3. Now again in session T1
> >
> > DROP TABLE test;
> >
> > -- will be this blocked ?
>
> DROP TABLE test
> *
> ERROR at line 1:
> ORA-00054: resource busy and acquire with NOWAIT specified
>
> However, after this, the update call is executed. After a commit in T2, test
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DROP TABLE commits transaction and releases EXCLUSIVE table lock...
> can be dropped.
No matter was table _really_ modified or not, T2 holds ROW EXCLUSIVE
table lock untill COMMIT/ABORT.
Well...
Vadim
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 1998-08-03 06:02:52 | Re: [HACKERS] OR with multi-key indexes |
Previous Message | Bruce Momjian | 1998-08-03 05:58:02 | Re: [HACKERS] TODO item: make pg_shadow updates more robust |