X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id DF105475AA9 for ; Sun, 6 Apr 2003 17:54:28 -0400 (EDT) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 405C2474E42 for ; Sun, 6 Apr 2003 17:54:25 -0400 (EDT) Received: by news.hub.org (Postfix, from userid 8) id 24CA443A89E; Sun, 6 Apr 2003 17:54:25 -0400 (EDT) From: saads@umich.edu (Saad Saeed) X-Newsgroups: comp.databases.postgresql.sql Subject: Creating a foreign key on the Union of two tables Date: 6 Apr 2003 14:53:50 -0700 Organization: http://groups.google.com/ Lines: 9 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 X-Complaints-To: groups-abuse@google.com To: pgsql-sql@postgresql.org Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-1.6 required=5.0 tests=BAYES_30 version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/95 X-Sequence-Number: 12796 I have 2 tables "A" and "B" in mySQL. They both have an attribute 'id' which is unique between the 2 tables. I want the union of these 2 attributes to be a foreign key in a 3rd table "C". How do I specify this constraing in sql (mySQL) in table C? And for complex reasons I cannot merge the 2 tables A and B. Thanks, -Saad