Thomas Swan <[EMAIL PROTECTED]> writes:
> Hypothetically, if I knew the relations that contained the tuples I was 
> locking, I could conceivably visit them in, let's say, alphabetical 
> order or oid order or any predictable order, and then select the rows 
> for update (using oid order or primary key order).  It would be hard to 
> induce a deadlock condition if the locks being acquired where in a 
> consistently reproducible order by all processes. 

Given that this requires programmer discipline anyway, I think it's okay
to leave the whole thing in the hands of the programmer.  My original
comment that the locks are acquired in an unpredictable order wasn't
right --- they are acquired by the executor's top level, therefore
in the order the rows come out of the execution engine, and therefore
you can make the order predictable if you want to.  Just use ORDER BY.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to