Skip site navigation (1) Skip section navigation (2)

Re: Lock

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Alfred Perlstein <bright(at)wintelcom(dot)net>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, patches(at)postgreSQL(dot)org
Subject: Re: Lock
Date: 2000-06-01 18:41:36
Message-ID: 200006011841.OAA20992@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Added to TODO.detail lock file.

> On Sat, 18 Dec 1999, Bruce Momjian wrote:
> 
> > [Charset ISO-8859-1 unsupported, filtering to ASCII...]
> > > I was looking at this
> > > 
> > > * Allow LOCK TABLE tab1, tab2, tab3 so all tables locked in unison
> > > 
> > > but I'm not sure if my solution is really what was wanted, because it
> > > doesn't actually guarantee an all-or-nothing lock, it just locks each
> > > table in order. Thus it's more like a syntax simplification and reduces
> > > overhead.
> > > 
> > 
> > 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.
> > 
> > Does this make sense?  It did to me.
> 
> Guys, have a look at:
> 
> http://www.freebsd.org/~terry/iml.txt
> http://jazz.external.hp.com/training/sqltables/c5s17.html
> 
> It's a way to do locking with deadlock detection, and without loosing
> your place in line for locks, very nifty imo.
> 
> -Alfred
> 
> 
> ************
> 
> 


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

pgsql-patches by date

Next:From: Peter EisentrautDate: 2000-06-02 23:48:33
Subject: Re: Industrial-Strength Logging
Previous:From: Bruce MomjianDate: 2000-06-01 18:02:08
Subject: Re: non-blocking patches.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group