Received: from rakete.joerdens.de ([62.104.116.200]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1L8Wwx59923 for ; Wed, 21 Feb 2001 03:32:59 -0500 (EST) (envelope-from frank@rakete.joerdens.de) Received: (from frank@localhost) by rakete.joerdens.de (8.9.3/8.9.3) id JAA20897; Wed, 21 Feb 2001 09:38:15 +0100 Date: Wed, 21 Feb 2001 09:38:15 +0100 From: Frank Joerdens To: Stephan Szabo Cc: Chris Czeyka , pgsql-sql@postgresql.org Subject: Re: two tables - foreign keys referring to each other... Message-ID: <20010221093815.A20690@rakete.joerdens.de> References: <3A93366B.DC0B83F4@skwea.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.1.2i In-Reply-To: ; from sszabo@megazone23.bigpanda.com on Tue, Feb 20, 2001 at 11:34:30PM -0800 X-Subliminal-Message: Use Linux! Use Linux! X-Archive-Number: 200102/320 X-Sequence-Number: 1516 On Tue, Feb 20, 2001 at 11:34:30PM -0800, Stephan Szabo wrote: > > You have to use ALTER TABLE to add the constraint to one of the tables. Maybe I am stating the obvious but you should make sure that you include the ALTER TABLE statements in the *.sql files that you use to create the tables, rather than running them from the psql prompt. Otherwise you'll have trouble to figure out what exactly you did when you come back to the database later; as foreign keys don't show up as 'foreign keys' in schema dumps, but as a set of triggers. Those are quite hard to read, or interpret as what they essentially are, i.e. foreign keys (depending on your philosophical outlook, that is, whether you consider the essence of your foreign keys to be a set of triggers, or vice versa ;-)). Regards, Frank