inheritance and primary/foreign keys - Mailing list pgsql-general

From Daniel J. Kressin
Subject inheritance and primary/foreign keys
Date
Msg-id 3AA6C4F6.E8DEEDD2@globalcrossing.com
Whole thread Raw
Responses Re: inheritance and primary/foreign keys
List pgsql-general
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?

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 *?

Thanks for your help.
--
Dan
 ____    Kressin   ____   .-----------------------------------.
/___ \____________/ __ \  | Unix SysAdmin                     |
    \  \    /      /  \ | | Global Crossing                   |
 ___/ __\/\/rench_ \__/ | | dkressin@globalcrossing.com       |
\____/            \____/  | http://www.vib.org/wrench/        |
                          `-----------------------------------'

pgsql-general by date:

Previous
From: Neil Conway
Date:
Subject: Re: explain -> how to optimize?
Next
From: Stephan Szabo
Date:
Subject: Re: inheritance and primary/foreign keys