Re: many columns with references to one table - Mailing list pgsql-general

From Dennis Gearon
Subject Re: many columns with references to one table
Date
Msg-id 3F4B768F.9070907@fireserve.net
Whole thread Raw
In response to many columns with references to one table  (Andreas Fromm <Andreas.Fromm@physik.uni-erlangen.de>)
List pgsql-general
You haven't given the table/column that it references, just the column I
assume.

Andreas Fromm wrote:

> Hi,
>
> What is the problem with the following table declaration?
>
> CREATE TABLE persons (
>  id SERIAL PRIMARY KEY,
>  name TEXT NOT NULL,
>  bdate DATE,
>  address INTEGER REFERENCES addresses,
>  phonepriv INTEGER REFERENCES phones,
>  phoneday INTEGER REFERENCES phones,
>  phonemobil INTEGER REFERENCES phones,
>  email INTEGER REFERENCES emails,
>  mate INTEGER REFERENCES persons,
>  updated DATE NOT NULL
> );
>
> My problem is that the references to the phones table do not get
> restricted, i.e. I can insert any value in the phone*-fields, while
> the references to the other tables are restricted to values that
> allready exists. The table declaration of phones should be all right,
> it has a primary key defined like every other tables I have. Is there
> a restriciton that no more then 1 column may reference an other table?
>
> Regards
>
> Andreas Fromm
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>


pgsql-general by date:

Previous
From: Dennis Björklund
Date:
Subject: Re: Index usage
Next
From: Dennis Gearon
Date:
Subject: Re: Linux ready for high-volume databases?