Ivano Luberti <luberti(at)archicoop(dot)it> writes:
> My problem is I know what query has failed , but I don't know the other
> one that caused the deadlock condition.
Ah. Is it practical for you to upgrade to PG 8.4? IIRC the deadlock
reporting code got improved in 8.4 to log all the queries involved.
regards, tom lane