Re: [GENERAL] Obtaining advisory lock using ORDER BY

2015-07-13 Thread Andreas Joseph Krogh
På mandag 13. juli 2015 kl. 16:22:28, skrev Tom Lane mailto:t...@sss.pgh.pa.us>>: Andreas Joseph Krogh writes: > I have this "dequeue" query which is working: > > select qe.entity_id, qe.queue_id, qe.sequence_id, qe.tx_id , qe.payload_string > fromorigo_queue_entry qe WHERE qe.queue_id = 2 AN

Re: [GENERAL] Obtaining advisory lock using ORDER BY

2015-07-13 Thread Tom Lane
Andreas Joseph Krogh writes: > I have this "dequeue" query which is working: >   > select qe.entity_id, qe.queue_id, qe.sequence_id, qe.tx_id , > qe.payload_string > fromorigo_queue_entry qe WHERE qe.queue_id = 2 AND pg_try_advisory_xact_lock( > sequence_id) LIMIT 1 FOR UPDATE ; > I'm not sure

[GENERAL] Obtaining advisory lock using ORDER BY

2015-07-13 Thread Andreas Joseph Krogh
Hi all.   I have this "dequeue" query which is working:   select qe.entity_id, qe.queue_id, qe.sequence_id, qe.tx_id , qe.payload_string fromorigo_queue_entry qe WHERE qe.queue_id = 2 AND pg_try_advisory_xact_lock( sequence_id) LIMIT 1 FOR UPDATE ; I'm not sure is this is guaranteed to lock in AS