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

From Si Chen
Subject Re: how to release a transaction lock on a table?
Date
Msg-id 41FE8A71.8090202@graciousstyle.com
Whole thread Raw
In response to Re: how to release a transaction lock on a table?  (Michael Fuhr <mike@fuhr.org>)
Responses Re: how to release a transaction lock on a table?
List pgsql-general
Thanks, Michael, for the input. Is there anyway in PostgreSQL to force
some transactions to close (rollback if necessary)? I notice there is no
way to release a LOCK manually.

Si

Michael Fuhr wrote:

>On Mon, Jan 31, 2005 at 10:13:26AM -0800, 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
>>
>>
>
>Look for other processes that have a lock on the table:
>
>SELECT * FROM pg_locks WHERE relation = 75907;
>
>If you have stats_command_string turned on then you can query
>pg_stat_activity to see what the other processes are doing.
>
>
>
>>Is there a way to release this lock?  Or does the database need to
>>re-started?
>>
>>
>
>Before taking drastic steps like restarting the database, find out
>who holds the conflicting lock and why.  You might have an application
>sitting idle in a transaction that it should be committing or rolling
>back, in which case the application should probably be fixed.
>
>
>

pgsql-general by date:

Previous
From: Steve Crawford
Date:
Subject: Re: Mail list / web issues
Next
From: PFC
Date:
Subject: Re: Howto determin the number of elemnts of an array