Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id E057F1DEF5C3 for ; Thu, 9 Aug 2012 21:19:57 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SzcxJ-0003EN-66 for pgsql-admin@postgresql.org; Fri, 10 Aug 2012 00:19:57 +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 q7A0JiAI008580; Thu, 9 Aug 2012 20:19:44 -0400 (EDT) From: Tom Lane To: Greg Williamson cc: "pgsql-admin@postgresql.org" Subject: Re: Question about ALTER TABLE DROP CONSTRAINT on 9.1 -- psql crashes In-reply-to: <1344557082.43876.YahooMailNeo@web125906.mail.ne1.yahoo.com> References: <1344557082.43876.YahooMailNeo@web125906.mail.ne1.yahoo.com> Comments: In-reply-to Greg Williamson message dated "Thu, 09 Aug 2012 17:04:42 -0700" Date: Thu, 09 Aug 2012 20:19:44 -0400 Message-ID: <8579.1344557984@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/68 X-Sequence-Number: 39889 Greg Williamson writes: > We have a small database (few hundred megs of data, lass than half that in indexes) that suffers from index bloat. Currently we handle this with an hourly REINDEX command. This works but causes some small issues, so I have been expploring other methods. > When I try to to drop constraints (typically UNIQUE) I sometimes get a crash of the psql client at the ALTER TABLE X DROP CONSTRAINT, and sometimes after I recreate the constraint at a commit. Transcript below: > usher=# BEGIN; > BEGIN > gusher=# ALTER TABLE ourcodes DROP CONSTRAINT IF EXISTS ourcodes_pkey CASCADE; > ALTER TABLE > gusher=# ALTER TABLE ourcodes ADD CONSTRAINT ourcodes_pkey PRIMARY KEY (id); > NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "ourcodes_pkey" for table "ourcodes" > ALTER TABLE > gusher=# COMMIT; > FATAL: terminating connection due to administrator command WTF? That should certainly not happen. Have you perhaps got a script that runs around sending SIGTERM to backends that it thinks are blocking something? Does anything show up in the postmaster log when this happens? regards, tom lane