Re: Revised Patch to allow multiple table locks in "Unison"

From: Fernando Nasser <fnasser(at)cygnus(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Neil Padgett <npadgett(at)redhat(dot)com>, "pgsql-patches(at)postgresql(dot)org" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Revised Patch to allow multiple table locks in "Unison"
Date: 2001-08-02 19:24:01
Message-ID: 3B69A8D1.CEE20D43@cygnus.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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(at)redhat(dot)com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2001-08-02 19:26:31 Re: Re: What needs to be done?
Previous Message Anders Bengtsson 2001-08-02 19:03:55 Re: Re: What needs to be done?

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2001-08-02 20:05:44 Re: Revised Patch to allow multiple table locks in "Unison"
Previous Message Dave Page 2001-08-02 19:04:39 RE: Patch for Improved Syntax Error Reporting