Re: [SQL] pg_advisory_lock(bigint) vs. LOCK TABLE

2008-07-18 Thread Alvaro Herrera
Mark Roberts wrote: > > 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 l

Re: [SQL] pg_advisory_lock(bigint) vs. LOCK TABLE

2008-07-18 Thread Mark Roberts
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. > > >

Re: [SQL] pg_advisory_lock(bigint) vs. LOCK TABLE

2008-07-17 Thread Tom Lane
Volkan YAZICI <[EMAIL PROTECTED]> writes: > On Thu, 17 Jul 2008, Alvaro Herrera <[EMAIL PROTECTED]> writes: >> They are two different lock spaces. pg_advisory_lock does not conflict >> with regular system locks, whereas LOCK TABLE does. > Is this documented in somewhere? I couldn't figure out tha

Re: [SQL] pg_advisory_lock(bigint) vs. LOCK TABLE

2008-07-17 Thread Volkan YAZICI
On Thu, 17 Jul 2008, Alvaro Herrera <[EMAIL PROTECTED]> writes: > Volkan YAZICI wrote: >> 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. Is this documen

Re: [SQL] pg_advisory_lock(bigint) vs. LOCK TABLE

2008-07-17 Thread Alvaro Herrera
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 Herrerahttp://www.CommandPrompt.co

[SQL] pg_advisory_lock(bigint) vs. LOCK TABLE

2008-07-16 Thread Volkan YAZICI
Hi, What's the difference between below two queue implementations? -- -- With advisory locks. -- BEGIN; SELECT pg_advisory_lock((SELECT oid FROM pg_class WHERE relname = 'queue')); DELETE FROM queue WHERE id = (SELECT MI