How fair is SELECT FOR UPDATE ?

Started by Csaba Nagyover 20 years ago2 messagesgeneral
Jump to latest
#1Csaba Nagy
nagy@ecircle-ag.com

Hi all,

I wonder how fair is the lock allocation of SELECT FOR UPDATE ?
Is it fair, i.e. the first transaction which requested the lock will get
it, or it is possible that new requests are served quicker ?

TIA,
Csaba.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Csaba Nagy (#1)
Re: How fair is SELECT FOR UPDATE ?

Csaba Nagy <nagy@ecircle-ag.com> writes:

I wonder how fair is the lock allocation of SELECT FOR UPDATE ?
Is it fair, i.e. the first transaction which requested the lock will get
it, or it is possible that new requests are served quicker ?

8.1 will guarantee first-come-first-served for row-level locks, but
prior releases make no guarantees.

regards, tom lane