X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id AEE30310E86 for ; Wed, 2 Jul 2003 04:15:00 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 58751-07 for ; Wed, 2 Jul 2003 01:14:50 -0300 (ADT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by svr1.postgresql.org (Postfix) with ESMTP id EEE6E310EBB for ; Wed, 2 Jul 2003 01:14:49 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 7F981D614; Tue, 1 Jul 2003 21:14:49 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 671235C0C; Tue, 1 Jul 2003 21:14:49 -0700 (PDT) Date: Tue, 1 Jul 2003 21:14:49 -0700 (PDT) From: Stephan Szabo To: Rudi Starcevic Cc: Subject: Re: Break referential integrity. In-Reply-To: <3F0258B6.1040908@oasis.net.au> Message-ID: <20030701211322.L66304-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200307/35 X-Sequence-Number: 14149 On Wed, 2 Jul 2003, Rudi Starcevic wrote: > Hi, > > I know that if you have a trigger and function then drop/replace the > function the trigger needs > to be drop/replaced too so that it can see the new function. > > Is it the same for Ref. Integ. on table's too ? > > If table B's foreign key references table A and you drop/replace table A > then the reference from table B to table A is broken and needs to be > recreated ? In recent versions, you should not be drop table A without specifying cascade which will drop the constraint for you (and thus you'll need to recreate it). In older versions, I'm not 100% sure what'd happen, but you probably should drop and recreate it for good measure.