From: | Nagib Abi Fadel <nagib_postgres(at)yahoo(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | refential integrity to multiple tables ?? |
Date: | 2003-10-08 05:53:25 |
Message-ID: | 20031008055325.874.qmail@web21412.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
HI,
let's say i have a tansaction table called TRANSACTION (transaction_id,amount,type,type_id)
Let's say a transaction can have multiple types: TYPE1, TYPE2 for example.
EACH type has his own definition and his own table.
Every transaction has a type that could be type1 or type2 that's why if the type is TYPE1 i want to make a referential integrity to the TYPE1_TABLE and if the type is TYPE2 i want to make a referential integrity to the TYPE2_TABLE.
IS IT POSSIBLE TO DO THAT???
I made a turn around to this problem by creating two tables:
- table TYPE1_TRANSACTION (type1_id,transaction_id)
- table TYPE2_TRANSACTION (type2_id,transaction_id)
But this does not seem so right for me ??
thx for any help
---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
From | Date | Subject | |
---|---|---|---|
Next Message | dipak_bhandari | 2003-10-08 06:46:35 | |
Previous Message | Oliver Elphick | 2003-10-08 04:01:41 | Re: Assigning Values to Arrays |