Yossi Cohen <yossic00@gmail.com> writes:
> If I request an advisory lock (pg_advisory_lock) with the same key from
> several sessions; will the lock be granted in the same order as it was
> requested?
Usually. IIRC, the lock code will grant locks out-of-order if a deadlock
would result without it. There might be some other exceptions but I
don't recall any.
regards, tom lane