Search Postgresql Archives

Re: how to release a transaction lock on a table?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Martha Stewart called it a Good Thing when schen@xxxxxxxxxxxxxxxxx (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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux