Re: two tables - foreign keys referring to each other...

From: Frank Joerdens <frank(at)joerdens(dot)de>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: Chris Czeyka <czeyka(at)skwea(dot)co(dot)jp>, pgsql-sql(at)postgresql(dot)org
Subject: Re: two tables - foreign keys referring to each other...
Date: 2001-02-21 08:38:15
Message-ID: 20010221093815.A20690@rakete.joerdens.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

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 <unnamed> 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Denis Perchine 2001-02-21 08:47:51 Re: postgres load
Previous Message Dan Wilson 2001-02-21 08:31:05 Re: Grant on Database?

Browse pgsql-sql by date

  From Date Subject
Next Message Grigoriy G. Vovk 2001-02-21 09:02:44 Re: two tables - foreign keys referring to each other...
Previous Message Stephan Szabo 2001-02-21 07:34:30 Re: [SQL] two tables - foreign keys referring to each other...