Re: Exclusive Locks Taken on User Tables? - Mailing list pgsql-general

From Tom Lane
Subject Re: Exclusive Locks Taken on User Tables?
Date
Msg-id 28413.1194379307@sss.pgh.pa.us
Whole thread Raw
In response to Re: Exclusive Locks Taken on User Tables?  (Marc <pgsql-general@mbreslow.net>)
Responses Re: Exclusive Locks Taken on User Tables?  ("Marc Breslow" <marc@mbreslow.net>)
List pgsql-general
Marc <pgsql-general@mbreslow.net> writes:
> This is the query that I'm running to view locks:
> SELECT pg_class.relname AS table,
>        pg_database.datname AS database,
>        transaction, pid, mode, granted
>  FROM pg_locks, pg_class, pg_database
> WHERE pg_locks.relation = pg_class.oid
>   AND pg_locks.database = pg_database.oid
> ORDER BY pg_class.relname, mode

> I'm pretty sure this filters out transactionid lock types because I'm
> joining to pg_database and pg_class.  Pls correct me if I'm wrong though.

It won't filter out row-level locks on rows within tables.  You're
probably looking at a transient row lock taken by a blocked SELECT FOR
UPDATE.  You didn't show exactly what the real problem was, but I'm
wondering if this is foreign-key conflicts in a pre-8.1 PG version.

            regards, tom lane

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Syntax error in a large COPY
Next
From: Tom Lane
Date:
Subject: Re: Syntax error in a large COPY