Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 135CF632CC1 for ; Mon, 7 Jun 2010 16:46:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 76261-10 for ; Mon, 7 Jun 2010 19:46:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id 0162A63293E for ; Mon, 7 Jun 2010 16:46:37 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id 0A869348037; Mon, 7 Jun 2010 12:46:33 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ketuzegCczBh; Mon, 7 Jun 2010 12:46:30 -0700 (PDT) Received: from perhan.alvh.no-ip.org (190-95-28-211.bk17-dsl.surnet.cl [190.95.28.211]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 8B175348035; Mon, 7 Jun 2010 12:46:30 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 79CC46E902; Mon, 7 Jun 2010 15:46:28 -0400 (CLT) Content-Type: text/plain; charset=UTF-8 Cc: pgsql-admin Subject: Re: Clearing locks From: Alvaro Herrera To: Matthew Excell In-reply-to: References: Date: Mon, 07 Jun 2010 15:46:28 -0400 Message-Id: <1275939916-sup-6638@alvh.no-ip.org> User-Agent: Sup/0.11 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.5 tagged_above=-10 required=5 tests=BAYES_05=-0.5 X-Spam-Level: X-Archive-Number: 201006/65 X-Sequence-Number: 34843 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 The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support