X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 73D65D1B982 for ; Fri, 27 Feb 2004 17:49:07 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 55546-09 for ; Fri, 27 Feb 2004 13:48:55 -0400 (AST) Received: from trade-india.com (unknown [61.16.154.82]) by svr1.postgresql.org (Postfix) with SMTP id ECD56D1B57C for ; Fri, 27 Feb 2004 13:48:49 -0400 (AST) Received: (qmail 14696 invoked from network); 27 Feb 2004 17:46:39 -0000 Received: from system66.trade-india-local.com (HELO office1.trade-india.com) (192.168.0.66) by system66.trade-india-local.com with SMTP; 27 Feb 2004 17:46:39 -0000 Received: from 192.168.0.100 (SquirrelMail authenticated user mallah) by system67.trade-india-local.com with HTTP; Fri, 27 Feb 2004 23:16:39 +0530 (IST) Message-ID: <3673.192.168.0.100.1077903999.squirrel@system67.trade-india-local.com> In-Reply-To: <20162.1077900973@sss.pgh.pa.us> References: <403EF608.7040005@trade-india.com> <20162.1077900973@sss.pgh.pa.us> Date: Fri, 27 Feb 2004 23:16:39 +0530 (IST) Subject: Re: ALTER table taking ages... From: mallah@trade-india.com To: "Tom Lane" Cc: pgsql-admin@postgresql.org User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/386 X-Sequence-Number: 12559 Thanks very much, Unfortunately i restarted the postmaster as we had to move forward. Since then i have not faced this problem. I shall post the results next time i face this kind of problem. Regds mallah. > Rajesh Kumar Mallah writes: >> It takes ages to drop a constraint from one of my tables >> [ table details at the end ] I cannot insert into it also. > > DROP CONSTRAINT in itself isn't going to take any significant amount of > time. The only plausible explanation is that some other session has a > lock on the table, forcing the DROP to wait. DROP is going to want > access-exclusive lock on the table, so pretty much anything will block it. > >> tradein_clients=# SELECT * from pg_locks where mode='ExclusiveLock' and >> granted is true; > > This is unhelpful. In the first place there are multiple kinds of lock > and you've shown only one. In the second place, the entries you want to > start from are the ones with granted not true, because that indicates > someone waiting for a lock. Try something like > > select h.pid as blocker, w.pid as blockee from pg_locks h, pg_locks w > where h.granted and not w.granted and > ((h.relation = w.relation and h.database = w.database) or > h.transaction = w.transaction); > > and then look in pg_stat_activity to find out what each process is > doing. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > >