On Thu, 2008-07-17 at 12:16 -0400, Alvaro Herrera wrote:
> Volkan YAZICI wrote:
> > Hi,
> >
> > What's the difference between below two queue implementations?
>
> They are two different lock spaces. pg_advisory_lock does not conflict
> with regular system locks, whereas LOCK TABLE does.
>
>
> --
> Alvaro Herrera http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.
>
It also appears that advisory locks are tied to your session, where
system locks are tied to your transaction. Also, lock table is a bit
more forceful, because it will affect things that don't bother checking
advisory locks (such as users, manual scripts, buggy applications, etc).
Don't forget that you can use select for update another locking
mechanism as well.
Well, that's my take on it.
-Mark