pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Beatrice Yueksel <beatrice@msys.ch>
Cc: pgsql-admin@postgresql.org
Subject: Re: question regarding REFERENCES and INHERITS
Date: Mon, 31 Mar 2003 08:37:49 -0800 (PST)
Message-ID: <20030331083401.D35743-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <3E881322.7050403@msys.ch>


On Mon, 31 Mar 2003, Beatrice Yueksel wrote:

> Hi,
> I made some test with REFERENCES and INHERITS.
> I know from the mailing list that :
> "Referential integrity only applies to the named table and not
> any child tables..."

As a note, this phrase was intended to apply to the target referenced
table (schiff_art in this case).

> I have 3 tables:
> art,
> schiff_admin (for administration with rules, view, etc...)
> schiff (inherits schiff_admin)
>
> There is one reference from schiff_admin to art.
> The reference doesn't work in schiff.
>
> If I add a constraint:
>
> ALTER TABLE schiff_admin
> ADD CONSTRAINT schiff_admin_fk_art
> FOREIGN KEY(art)
> REFERENCES
> schiff_art (art) ON DELETE NO ACTION ;
>
> the reference works also in schiff.
>
> Why the reference is inherited after the "alter table" and not before?

Because inheritance is wierd right now :)  Seriously, the alter table
is appearing to recurse the tree (as of the time the constraint is made),
however create table inherits doesn't make the triggers.  With
pg_constraint in place, that might actually not be as hard now.




view thread (2+ messages)

Message-ID: <20030331083401.D35743-100000@megazone23.bigpanda.com>
Permalink:  ../20030331083401.D35743-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20030331083401.D35743-100000@megazone23.bigpanda.com

 · 

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-admin@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, beatrice@msys.ch
  Subject: Re: question regarding REFERENCES and INHERITS
  In-Reply-To: <20030331083401.D35743-100000@megazone23.bigpanda.com>
  References: <3E881322.7050403@msys.ch> <20030331083401.D35743-100000@megazone23.bigpanda.com>

* 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