Re: Revised Patch to allow multiple table locks in "Unison" - Mailing list pgsql-patches

From Fernando Nasser
Subject Re: Revised Patch to allow multiple table locks in "Unison"
Date
Msg-id 3B69A8D1.CEE20D43@cygnus.com
Whole thread Raw
In response to Re: Revised Patch to allow multiple table locks in "Unison"  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Revised Patch to allow multiple table locks in "Unison"
List pgsql-patches
Bruce Momjian wrote:
>
> Oh, OK.  Just checking.  It seems the starvation problem kept hitting us
> as soon as we fixed the deadlock, cycling problem, and I was wondering
> if there even was a solution.  My guess is that you would have to put
> the multi-lock request in several lock queues and make sure they all got
> done at some point.  A mess.
>

What about having the syntax

LOCK a,b,c;

now just as a shorthand for

LOCK a;
LOCK b;
LOCK c;

This would save typing and allow for Oracle compatibility.


If one day we get a multiple-lock facility inside the
lock manager, we add the optional keyword "SIMULTANEOUSLY"
so that other mode is used instead.


One more reason for adding the "simple" version of the multiple
lock is that we may need it already.

I wonder how we handle

LOCK v;

where "v" is a view.  We should be locking all the base tables.

Suppose that the base tables for "v" are "a", "b" and "c".
In this case

LOCK v;

should be rewritten as

LOCK a,b,c;





--
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Patch for Improved Syntax Error Reporting
Next
From: Tom Lane
Date:
Subject: Re: Revised Patch to allow multiple table locks in "Unison"