Re: ExclusiveLock without a relation in pg_locks

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Carlos Oliva <carlos(at)pbsinet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ExclusiveLock without a relation in pg_locks
Date: 2006-02-23 18:36:16
Message-ID: 20060223183616.GA43646@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Feb 23, 2006 at 01:23:36PM -0500, Carlos Oliva wrote:
> Yes. I am seeing that situation often in our database.
>
> The query field of pg_stat_activity is SELECT ..., not SLECT UPDATE or
> UPDATE or INSERT or DELETE. I was expecting the query to say something like
> SLECT UPDATE or something like that. Also the query seems to have just
> columns in the select statement; not functions.
>
> I will look further into these queries in case that they are using
> functions.

Are the ExclusiveLock locks for relations or for transaction IDs?
Also, once a lock is acquired it's held until the transaction
completes, so if the transaction ever acquired that lock then the
transaction would still be holding it.

If you can't figure out what's happening then it might be useful
to see the output of

SELECT relation::regclass, * FROM pg_locks;

A self-contained test case might also be useful. If you show what
commands you're running and what pg_locks output you don't understand,
then somebody might be able to explain what's happening.

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Harald Armin Massa 2006-02-23 18:45:49 Error correction to FAQ
Previous Message Rodrigo Sakai 2006-02-23 18:34:36 Temporal Databases