Re: Creating a foreign key on the Union of two tables

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: saads(at)umich(dot)edu (Saad Saeed), pgsql-sql(at)postgresql(dot)org
Subject: Re: Creating a foreign key on the Union of two tables
Date: 2003-04-07 18:27:03
Message-ID: 200304071127.03166.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Saad,

> 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.

IMHO, you cannot do this in MySQL. How about upgrading to PostgreSQL? Then
we can help you.

--
-Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 2003-04-07 21:41:00 Re: Creating a foreign key on the Union of two tables
Previous Message Bruno Wolff III 2003-04-07 16:50:30 Re: Creating a foreign key on the Union of two tables