Re: pg_locks needs a facelift

From: Alvaro Herrera
Subject: Re: pg_locks needs a facelift
Date: ,
Msg-id: 20050502172302.GA3353@dcc.uchile.cl
(view: Whole thread, Raw)
In response to: Re: pg_locks needs a facelift  ("Merlin Moncure")
List: pgsql-hackers

Tree view

pg_locks needs a facelift  (Tom Lane, )
 Re: pg_locks needs a facelift  ("Merlin Moncure", )
  Re: pg_locks needs a facelift  (Tom Lane, )
 Re: pg_locks needs a facelift  ("Merlin Moncure", )
  Re: pg_locks needs a facelift  (Alvaro Herrera, )
  Re: pg_locks needs a facelift  (Tom Lane, )
   Re: pg_locks needs a facelift  ("Jim C. Nasby", )
 Re: pg_locks needs a facelift  ("Merlin Moncure", )
 Re: pg_locks needs a facelift  ("Merlin Moncure", )
  Re: pg_locks needs a facelift  (Tom Lane, )
  Re: pg_locks needs a facelift  ("Jim C. Nasby", )
 Re: pg_locks needs a facelift  ("Merlin Moncure", )
  Re: pg_locks needs a facelift  (Alvaro Herrera, )
  Re: pg_locks needs a facelift  (Tom Lane, )
 Re: pg_locks needs a facelift  ("Merlin Moncure", )
  Re: pg_locks needs a facelift  ("Jim C. Nasby", )
   Re: pg_locks needs a facelift  (Tom Lane, )
    Re: pg_locks needs a facelift  ("Jim C. Nasby", )
 Re: pg_locks needs a facelift  ("Merlin Moncure", )

On Mon, May 02, 2005 at 01:12:06PM -0400, Merlin Moncure wrote:

> I don't like the idea of listing user locks with 'tuple' locks for no
> other reason than this might confuse what user locks are. Even though
> they will be used as tuple locks 99% of the time, user locks are only
> loosely coupled with tuples in part because there is no sytem generated
> column which is persistent and > 32 bits.  IMO, this is a problem with
> the current user lock module...it encourages locking over oid which is a
> bad practice.

Another way would be to allow user locks to use the four fields of
LOCKTAG.  So the user would be able to establish more powerful
conventions: say the relation's Oid, and a related sequence value if
there is one; or a blocknumber/offset (ctid) if there isn't, etc.

>  A properly implemented user lock system would likely
> maintain a global sequence shared by all lockable objects, tuple or
> otherwise.

That'd just be equivalent to require that user tables are created WITH
OIDS, only the counter wouldn't be shared with system tables ... how is
that any better?

-- 
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"Ellos andaban todos desnudos como su madre los parió, y también las mujeres,
aunque no vi más que una, harto moza, y todos los que yo vi eran todos
mancebos, que ninguno vi de edad de más de XXX años" (Cristóbal Colón)



pgsql-hackers by date:

From: "Jim C. Nasby"
Date:
Subject: Re: [pgsql-advocacy] Increased company involvement
From: Andrew Dunstan
Date:
Subject: Re: [pgsql-advocacy] Increased company involvement