pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Matthew Excell <mexcell@ucentive.net>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Clearing locks
Date: Mon, 07 Jun 2010 15:46:28 -0400
Message-ID: <1275939916-sup-6638@alvh.no-ip.org> (raw)
In-Reply-To: <AANLkTikxe6Scg9Y0DjrRILmQE9un2rWQgJi-70oxdkVj@mail.gmail.com>
References: <AANLkTikxe6Scg9Y0DjrRILmQE9un2rWQgJi-70oxdkVj@mail.gmail.com>

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@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



view thread (3+ messages)  latest in thread

Message-ID: <1275939916-sup-6638@alvh.no-ip.org>
Permalink:  ../1275939916-sup-6638@alvh.no-ip.org/
Also on:    postgresql.org/message-id/1275939916-sup-6638@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: alvherre@commandprompt.com, mexcell@ucentive.net
  Subject: Re: Clearing locks
  In-Reply-To: <1275939916-sup-6638@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox