Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 9BCF4475C91 for ; Mon, 29 Apr 2002 16:51:47 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 95C69475A10 for ; Mon, 29 Apr 2002 16:50:51 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id E2F88D5F7; Mon, 29 Apr 2002 13:50:51 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id CE9B65C01; Mon, 29 Apr 2002 13:50:51 -0700 (PDT) Date: Mon, 29 Apr 2002 13:50:51 -0700 (PDT) From: Stephan Szabo To: Mike Baker Cc: Subject: Re: ALTER TABLE hangs In-Reply-To: <20020429204207.91047.qmail@web13802.mail.yahoo.com> Message-ID: <20020429134741.S65313-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200204/285 X-Sequence-Number: 4173 On Mon, 29 Apr 2002, Mike Baker wrote: > Hi. > > I am in the process of doing some data migration. I > have had no trouble moving my data, but am having > problems creating a foreign key. > > When I run the following command, psql hangs (well, > not totally sure if it is hung). It probably isn't hung, but it's going to go through every row of the table to make sure the constraint holds successfully which is going to result in 380,000 queries again t_release_component. I haven't had time recently to do any of the fk stuff I've been meaning to do, but this is optimizable for most cases, but it hasn't been done.