refential integrity to multiple tables ?? - Mailing list pgsql-general

From Nagib Abi Fadel
Subject refential integrity to multiple tables ??
Date
Msg-id 20031008055325.874.qmail@web21412.mail.yahoo.com
Whole thread Raw
Responses Re: refential integrity to multiple tables ??  (Erik Ronström <kvarken@yahoo.com>)
Re: refential integrity to multiple tables ??  (Richard Huxton <dev@archonet.com>)
List 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

pgsql-general by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: Assigning Values to Arrays
Next
From: Eric Tan
Date:
Subject: Does postgresql support HKSCS ?