"Robert B. Easter" <reaster@comptechnews.com> writes:
> Is my database design flawed if this occurs?
The db layout is probably not the issue, but I'd say your scripts are
flawed.
The usual recipe for avoiding deadlocks is pretty simple: all acquirers
of locks must grab the locks in the same order.
regards, tom lane