Locking tables in PostgreSQL: a cure worse than the disease?

When rows are processed in a deterministic order, deadlocks are less likely — though that gets tricky for DML statements that touch more than one row. That much is worth agreeing with. Where the advice goes wrong, in my experience, is the suggestion to lock tables.

An explicit table lock prevents concurrency outright, which makes it almost always the wrong answer: a cure that is worse than the disease.

Of course, it is possible the original point was something else entirely.

I agree with processing rows in some deterministic order, but I think that locking tables is bad advice.