pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank Joerdens <frank@joerdens.de>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: Chris Czeyka <czeyka@skwea.co.jp>
Cc: pgsql-sql@postgresql.org
Subject: Re: two tables - foreign keys referring to each other...
Date: Wed, 21 Feb 2001 09:38:15 +0100
Message-ID: <20010221093815.A20690@rakete.joerdens.de> (raw)
In-Reply-To: <Pine.BSF.4.21.0102202333230.6437-100000@megazone23.bigpanda.com>
References: <3A93366B.DC0B83F4@skwea.co.jp>
	<Pine.BSF.4.21.0102202333230.6437-100000@megazone23.bigpanda.com>

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



view thread (8+ messages)  latest in thread

Message-ID: <20010221093815.A20690@rakete.joerdens.de>
Permalink:  ../20010221093815.A20690@rakete.joerdens.de/
Also on:    postgresql.org/message-id/20010221093815.A20690@rakete.joerdens.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: frank@joerdens.de, sszabo@megazone23.bigpanda.com, czeyka@skwea.co.jp
  Subject: Re: two tables - foreign keys referring to each other...
  In-Reply-To: <20010221093815.A20690@rakete.joerdens.de>
  References: <3A93366B.DC0B83F4@skwea.co.jp> <Pine.BSF.4.21.0102202333230.6437-100000@megazone23.bigpanda.com> <20010221093815.A20690@rakete.joerdens.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox