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

Поиск
Список
Период
Сортировка
От Christopher Browne
Тема Re: how to release a transaction lock on a table?
Дата
Msg-id m3wttnjbgf.fsf@knuth.knuth.cbbrowne.com
обсуждение исходный текст
Ответ на how to release a transaction lock on a table?  (Si Chen <schen@graciousstyle.com>)
Список 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 по дате отправления:

Предыдущее
От: Christopher Browne
Дата:
Сообщение: Re: is this index bloat?
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: pgpool simple feature request