On 1999-12-18, Bruce Momjian mentioned:

> > * Allow LOCK TABLE tab1, tab2, tab3 so all tables locked in unison

> It took a few minutes, but I remember the use for this.  If you are
> going to hang waiting to lock tab3, you don't want to lock tab1 and tab2
> while you are waiting for tab3 lock.  The user wanted all tables to lock
> in one operation without holding locks while waiting to complete all
> locking.
> 
> Can you do the locks, and if one fails, not hang, but unlock the
> previous tables, go lock/hang on the failure, and go back and lock the
> others? Seems it would have to be some kind of lock/fail/unlock/wait
> loop.

That's what I suspected. But of course LockRelation() doesn't return
anything based on whether it succeeded, it just hangs, so it'll take a
little more work. Next year ...

-- 
Peter Eisentraut                  Sernanders vï¿½g 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



Mon, 20 Dec 1999 01:18:29 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: [PATCHES] Lock
[Charset ISO-8859-1 unsupported, filtering to ASCII...]
> On 1999-12-18, Bruce Momjian mentioned:
> 
> > > * Allow LOCK TABLE tab1, tab2, tab3 so all tables locked in unison
> 
> > It took a few minutes, but I remember the use for this.  If you are
> > going to hang waiting to lock tab3, you don't want to lock tab1 and tab2
> > while you are waiting for tab3 lock.  The user wanted all tables to lock
> > in one operation without holding locks while waiting to complete all
> > locking.
> > 
> > Can you do the locks, and if one fails, not hang, but unlock the
> > previous tables, go lock/hang on the failure, and go back and lock the
> > others? Seems it would have to be some kind of lock/fail/unlock/wait
> > loop.
> 
> That's what I suspected. But of course LockRelation() doesn't return
> anything based on whether it succeeded, it just hangs, so it'll take a
> little more work. Next year ...

Yep, I figured it would be weird to get working.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Sun, 19 Dec 1999 21:15:28 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] Re: [PATCHES] Lock
>> That's what I suspected. But of course LockRelation() doesn't return
>> anything based on whether it succeeded, it just hangs, so it'll take a
>> little more work. Next year ...

I think this would actually have to be implemented inside the lock
manager in order to make it work right.

			regards, tom lane

Sun, 19 Dec 1999 22:13:06 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Re: [PATCHES] Lock 