Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f78GUo698615 for ; Wed, 8 Aug 2001 12:30:50 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 98848; Wed, 08 Aug 2001 09:30:43 -0700 From: "Josh Berkus" Subject: Re: REFERENCES constraint To: Cedar Cox , pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Wed, 08 Aug 2001 09:30:43 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200108/130 X-Sequence-Number: 4351 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 information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco