From: | "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> |
---|---|
To: | "Michael P(dot) Soulier" <michael_soulier(at)mitel(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: apparent deadlock |
Date: | 2008-11-18 19:26:55 |
Message-ID: | dcc563d10811181126r5e8ff4c8qd7c16cce391ab04a@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Tue, Nov 18, 2008 at 11:43 AM, Michael P. Soulier
<michael_soulier(at)mitel(dot)com> wrote:
> Hello,
>
> I'm working with Pg 7.4 on CentOS, and I'm seeing an apparent deadlock which
> is not resolving itself.
>
> According to the postgres documentation, deadlocks should be detected and
> resolved by killing one or more transactions involved.
>
> http://www.postgresql.org/docs/current/static/explicit-locking.html
>
> What I'm seeing is an upgrade of an application running a series of alter
> table commands to migrate the db schema, but blocking during the process and
> never continuing. I finally had to restart the db to unblock the process.
Just because you've got a blocking transaction doesn't mean it's a
deadlock. A deadlock means you have two transactions, each of which
is waiting for the other to continue before it can go on. If one
query is holding up another query, but not vice versa, it's not a
deadlock, just a lock.
> Does anyone have any suggestions for troubleshooting a potential deadlock like
> this? I'm not sure how to query existing locks on tables, for example, which
> might tell me where the issue is.
First place to start is the view pg_locks
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Kellerer | 2008-11-18 19:33:28 | Re: MVCC and index-only read |
Previous Message | Jonah H. Harris | 2008-11-18 19:15:38 | Re: MVCC and index-only read |