Re: pg_locks needs a facelift - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: pg_locks needs a facelift
Date
Msg-id 20050502172302.GA3353@dcc.uchile.cl
Whole thread Raw
In response to Re: pg_locks needs a facelift  ("Merlin Moncure")
List pgsql-hackers
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:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: [pgsql-advocacy] Increased company involvement
Next
From: Bruce Momjian
Date:
Subject: Re: [pgsql-advocacy] Increased company involvement