Re: REFERENCES constraint - Mailing list pgsql-sql

From Josh Berkus
Subject Re: REFERENCES constraint
Date
Msg-id web-98848@davinci.ethosmedia.com
Whole thread Raw
In response to REFERENCES constraint  (Cedar Cox <cedarc@visionforisrael.com>)
List pgsql-sql
Cedar,

(sorry for the double posting, folks)

> 2. Can a column reference another column in the same table?  eg..
> 
>   CREATE TABLE bloo (
>     id int4,
>     p_id int4 REFERENCES bloo (id)
>   -- or
>   --p_id int4 REFERENCES (id)
>   )

You don't do this with REFERENCES ... you do it with a CHECK CONSTRAINT
(look it up in the docs).

-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: Functions returning more than one value
Next
From: "Grigoriy G. Vovk"
Date:
Subject: Re: REFERENCES constraint