Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4MTs-0008Ne-I0 for pgsql-admin@postgresql.org; Thu, 23 Aug 2012 01:45:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4MTr-0005c8-IV for pgsql-admin@postgresql.org; Thu, 23 Aug 2012 01:45:07 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q7N1j6pJ027814; Wed, 22 Aug 2012 21:45:06 -0400 (EDT) From: Tom Lane To: Greg Williamson cc: "pgsql-admin@postgresql.org" Subject: Re: creating trigger in 8.3 -- very slow In-reply-to: <1345684578.14923.YahooMailNeo@web125904.mail.ne1.yahoo.com> References: <1345684578.14923.YahooMailNeo@web125904.mail.ne1.yahoo.com> Comments: In-reply-to Greg Williamson message dated "Wed, 22 Aug 2012 18:16:18 -0700" Date: Wed, 22 Aug 2012 21:45:06 -0400 Message-ID: <27813.1345686306@sss.pgh.pa.us> X-Pg-Spam-Score: -2.1 (--) X-Archive-Number: 201208/100 X-Sequence-Number: 39921 Greg Williamson writes: > I've got a fairly large table (186 million rows) that is moderately busy ( a few inserts per second at most) that I am trying to create a trigger on --  it is just hanging. CREATE TRIGGER per se is pretty quick ... but it requires an exclusive lock on the table. Most likely your problem is that it's backed up behind existing holders of locks. The pg_locks view should help you figure out what's blocking it. regards, tom lane