pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: saads@umich.edu
To: pgsql-sql@postgresql.org
Subject: Re: Creating a foreign key on the Union of two tables
Date: Mon, 7 Apr 2003 11:27:03 -0700
Message-ID: <200304071127.03166.josh@agliodbs.com> (raw)
In-Reply-To: <a811aba0.0304061353.664e2263@posting.google.com>
References: <a811aba0.0304061353.664e2263@posting.google.com>

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




view thread (5+ messages)  latest in thread

Message-ID: <200304071127.03166.josh@agliodbs.com>
Permalink:  ../200304071127.03166.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200304071127.03166.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, saads@umich.edu
  Subject: Re: Creating a foreign key on the Union of two tables
  In-Reply-To: <200304071127.03166.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox