Re: [HACKERS] Reproducable deadlock situation (possibly with foreign keys)

2005-11-16 Thread Alvaro Herrera
Mario Weilguni wrote: > Ok, this my fault, and you're right. > > I took the query from the error messages (a 8.0.3 DB) and applied it to a 8.1 > DB on a testing system without thinking too much. > > Still I think reordering those queries might prevent a deadlock. Well, if we could reorder them,

Re: [HACKERS] Reproducable deadlock situation (possibly with foreign keys)

2005-11-16 Thread Mario Weilguni
Ok, this my fault, and you're right. I took the query from the error messages (a 8.0.3 DB) and applied it to a 8.1 DB on a testing system without thinking too much. Still I think reordering those queries might prevent a deadlock. Best regards Am Mittwoch, 16. November 2005 12:21 schrieb Alvaro

Re: [HACKERS] Reproducable deadlock situation (possibly with foreign keys)

2005-11-16 Thread Alvaro Herrera
Mario Weilguni wrote: Hi, > T1: BEGIN; > T2: BEGIN; > -- these are the queries similar to those from the foreign key code > T1: SELECT 1 FROM ONLY lookup1 x WHERE "id" = 1 FOR UPDATE OF x; > T2: SELECT 1 FROM ONLY lookup2 x WHERE "id" = 3 FOR UPDATE OF x; > T1: SELECT 1 FROM ONLY lookup2 x WHERE

[HACKERS] Reproducable deadlock situation (possibly with foreign keys)

2005-11-16 Thread Mario Weilguni
I've a problem occurring daily for me, I get quite a few deadlocks every day, and the concurrency is not so high. Happens with postgresql 8.0 and 8.1. as well... Here's a self-contained testcase, which I think it might be the problem I have in our production database. While it might be some sor