Foreign Key problem

From: David Mulcahy <eseol(at)mersinet(dot)co(dot)uk>
To: pgsql-novice(at)postgresql(dot)org
Subject: Foreign Key problem
Date: 2001-08-13 16:57:49
Message-ID: 3B78070D.DCD0D282@mersinet.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I am having problems trying to create the following. Any suggestions
would be greatly appreciated.

CREATE TABLE "t0" (
"id" integer,
"table" character(1),
"product" character(1),
Primary Key ("id", "table")
);

CREATE TABLE "t1" (
"id" integer,
"table" character(1),
"product" text,
Primary Key ("id", "table")
);
CREATE TABLE "t3" (
"num" integer,
"id" integer REFERENCES t0 and t1,
"table" character(1) REFERENCES t0 and t1,
Primary Key ("num", "id", "table")
);

Is it possible to have a foreign key reference two tables like in the
above example if so how would I do it. I am using postgresql v 7.1.2.

Thanks in advance
David Mulcahy

Browse pgsql-novice by date

  From Date Subject
Next Message Noah Roberts 2001-08-13 17:26:20 permission errors
Previous Message Karel Zak 2001-08-13 10:11:13 Re: [SQL] Arithmetic operation on DATE