Alvaro Herrera <[EMAIL PROTECTED]> 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

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply via email to