From: | "Eric G(dot) Miller" <egm2(at)jps(dot)net> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: inheritance and primary/foreign keys |
Date: | 2001-03-09 02:14:37 |
Message-ID: | 20010308181437.C26629@calico.local |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, Mar 07, 2001 at 03:54:02PM -0800, Stephan Szabo wrote:
> On Wed, 7 Mar 2001, Daniel J. Kressin wrote:
>
> > Question 1: If table A has as its primary key "a_pk" and table B
> > inherits table A, then table B also has as its primary key a_pk. Is
> > that correct?
>
> I don't believe so currently.
>
> > Question 2: If I want table C to have a foreign key on both A and B, is
> > the following syntax correct? (I'm using 7.0.3)
> > CREATE TABLE c (
> > c_fk correct_type REFERENCES a*(a_pk)
> > );
> > (The question is, Do I need the *?)
> >
> > Question 3: I understand that the default action on this will reverse in
> > 7.1 (i.e. the default will then be to reference all tables unless ONLY
> > is specified). Am I correct in assuming that the dump/restore (required
> > for upgrading) will take care of this, or will I need to recreate table
> > C manually removing the *?
>
> You cannot safely reference tops of inheritance trees under 7.0 or 7.1 and
> have it reference the trees.
>
> Which reminds me, the fk constraint triggers should probably specify ONLY
> on their queries or they'll fail strangely under 7.1.
Can someone give a good use for this inheritance thing? I've never been
able to come up with a scenario where it makes sense. It always seems
more problematic than just using multiple related tables.
--
Eric G. Miller <egm2(at)jps(dot)net>
From | Date | Subject | |
---|---|---|---|
Next Message | Sam and Lisa Snow | 2001-03-09 04:13:20 | RE: Win32 Postgresql |
Previous Message | Daniel J. Kressin | 2001-03-09 01:46:36 | table name case sensitivity |