Re: [WIP] The shared dependency patch - Mailing list pgsql-patches

From Tom Lane
Subject Re: [WIP] The shared dependency patch
Date
Msg-id 26134.1103219206@sss.pgh.pa.us
Whole thread Raw
In response to [WIP] The shared dependency patch  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Responses Re: [WIP] The shared dependency patch  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List pgsql-patches
Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> I was trying to find out if I could lock the user (and have the ALTER
> TABLE get a shared lock on the user before checking its existance, and
> the DROP USER get an exclusive lock which would be release at
> transaction end.  So everything would remain consistant.)  However the
> LOCKTAG does not have provisions to lock arbitrary objects, only
> relations (I could end up locking some completely unrelated table, I
> guess).

IIRC, Rod Taylor did some work on supporting locks for non-table objects
back around the beginning of the year.  We rejected the patch for various
reasons but you might be able to adopt some of it.

Or you could do something like the pg_xactlock hack.  Basically you need
a convention that identifies a LOCKTAG value as locking a particular
user, such that it can't exactly equal any lock on a regular relation.

            regards, tom lane

pgsql-patches by date:

Previous
From: "Zeugswetter Andreas DAZ SD"
Date:
Subject: Re: Threading fix for AIX
Next
From: "Magnus Hagander"
Date:
Subject: Re: Patch to add version numbers to libpq.rc