Re: FKs and deadlocks - Mailing list pgsql-general

From Philippe Lang
Subject Re: FKs and deadlocks
Date
Msg-id 6C0CF58A187DA5479245E0830AF84F4208045F@poweredge.attiksystem.ch
Whole thread Raw
In response to FKs and deadlocks  ("Philippe Lang" <philippe.lang@attiksystem.ch>)
Responses Re: FKs and deadlocks  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Re: FKs and deadlocks  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Thanks a lot Tom.

One more question: i'm surprised there are so many ExclusiveLocks when displaying pg_lock:

33044    32920        11439    RowExclusiveLock    t
        6514392    14385    ExclusiveLock    t
        6495858    11439    ExclusiveLock    t
...etc...

I found in the documentation "EXCLUSIVE: This lock mode is not automatically acquired by any PostgreSQL command."

I'm not using any TABLE LOCK or SET TRANSACTION ISOLATION call in the whole database, so where do they come from? I'm
accessingthe database through ODBC, is that maybe the reason? 

Philippe


-----Message d'origine-----
De : Tom Lane [mailto:tgl@sss.pgh.pa.us]
Envoyé : lundi, 25. octobre 2004 16:16
À : Philippe Lang
Cc : pgsql-general@postgresql.org
Objet : Re: [GENERAL] FKs and deadlocks

"Philippe Lang" <philippe.lang@attiksystem.ch> writes:
> I got a deadlock in my database this morning.

There is no deadlock here.  The ungranted rows in pg_locks all point to the transaction ID 6489299, which belongs to
PID11346, which is this 
one:

> 11346  ??  R    236:43.23 postmaster: jlroubaty groupefpdb 172.17.10.14 UPDATE (postgres)

An UPDATE that churns for hours and hours may well represent a bug in your application (unconstrained join maybe?) but
it'snot a deadlock. 

            regards, tom lane


pgsql-general by date:

Previous
From: "Vassilev, Lubomir G."
Date:
Subject: Re: how to port Oracle database to PostgreSQL?
Next
From: Alvaro Herrera
Date:
Subject: Re: FKs and deadlocks