Re: Clearing locks

From: Matthew Excell <mexcell(at)ucentive(dot)net>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Clearing locks
Date: 2010-06-07 19:59:13
Message-ID: AANLkTimqKX_b5k8QsvoY2oU7yojWYeIMLNlXXNNNSiQO@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

That did it. Thanks!

Matthew Excell

On Mon, Jun 7, 2010 at 1:46 PM, Alvaro Herrera
<alvherre(at)commandprompt(dot)com>wrote:

> Excerpts from Matthew Excell's message of lun jun 07 15:33:27 -0400 2010:
> > I'm on PostgreSQL 8.3.11 on Debian.
> >
> > I have a small piece of DDL (alter table title drop column is_target)
> that
> > hangs "waiting" forever. (I've waited hours - it still shows as waiting
> in
> > pg_top.) I have restarted the database - even tried it in single-user
> mode
> > - but it still waits.
> >
> > When I execute a query to get lock info:
> >
> > select
> >
> pg_class.relname,pg_locks.locktype,mode,virtualtransaction,database,relation,granted
> > from pg_class,pg_locks where pg_class.relfilenode=pg_locks.relation;
> >
> > (These are all the columns in pg_locks with anything but null in them.)
> >
> > relname | locktype | mode |
> > virtualtransaction | database | relation | granted
> >
> --------------------------------------+----------+-----------------+--------------------+----------+----------+---------
> > property_key_name_index | relation | AccessShareLock |
> > -1/22805859 | 64197 | 361377 | t
>
> uh. Check pg_prepared_transactions (or was it pg_prepared_xacts?) and
> do a ROLLBACK PREPARED (or COMMIT PREPARED) if there's anything that
> shouldn't be there.
>
> --
> Álvaro Herrera <alvherre(at)commandprompt(dot)com>
> The PostgreSQL Company - Command Prompt, Inc.
> PostgreSQL Replication, Consulting, Custom Development, 24x7 support
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Gnanakumar 2010-06-08 05:22:33 Re: PITR Recovery Question
Previous Message Alvaro Herrera 2010-06-07 19:46:28 Re: Clearing locks