Re: how to release a transaction lock on a table? - Mailing list pgsql-general

From Christopher Browne
Subject Re: how to release a transaction lock on a table?
Date
Msg-id m3wttnjbgf.fsf@knuth.knuth.cbbrowne.com
Whole thread Raw
In response to how to release a transaction lock on a table?  (Si Chen <schen@graciousstyle.com>)
List pgsql-general
Martha Stewart called it a Good Thing when schen@graciousstyle.com (Si Chen) wrote:
> Hello everyone.  I am trying to do an ALTER TABLE, but it hangs
> indefinitely.  I think the table is locked from a transaction, and in
> pg_locks I found:
> relation  75907
> database 74861
> pid 29604
> mode AccessExclusiveLock
> granted f
>
> Is there a way to release this lock?  Or does the database need to
> re-started?

Note that it says "granted f".

The lock has only been requested; it hasn't been granted.

Some other transaction is holding onto the table and preventing that
lock from being acquired.

You might indeed want to rummage around and see what other locks there
are on the table, and perhaps interrupt the other processing.

This sort of maintenance may require locking out "application users"
so that you can get all of the locks you need to upgrade the
application.

It oughtn't be necessary to shut down the DB, though.
--
select 'cbbrowne' || '@' || 'gmail.com';
http://www3.sympatico.ca/cbbrowne/nonrdbms.html
"I've seen estimates that 10% of all IDs in the US are phony. At least
one-fourth of the president's own family has been known to use phony
IDs." -- Bruce Schneier CRYPTO-GRAM, December 15, 2001

pgsql-general by date:

Previous
From: Christopher Browne
Date:
Subject: Re: is this index bloat?
Next
From: "Joshua D. Drake"
Date:
Subject: pgpool simple feature request