|
Foriegn key to Union query or two tables: msg#00237db.postgresql.novice
Hi all, I have two tables 'composition_type' and 'mineral_type'. Both tables have a number field for their primary key(comp_id & min_id) and their primary keys are unique between the two tables. The third table is 'rock_sample' which has a column 'composition'. Now the rock_sample.compsition column can be filled with a with either compositon_type.comp_id or mineral_type.min_id. So how can I create a foreign key for rock_samp.composition referencing composition_type.comp_id AND mineral_type.min_id? I know some might/will say why are the two tables not just merged into one but they are under normal circumstances two different things with difference mutually exclusive attributes. Also in other situations I need them appart. Any suggestions? I just tried adding a foreign key referencing a VIEW with a UNION query and psql just spit it back. Thanks, Phillip J. Allen Consulting Geochemist/Geologist Lima Peru e-mail: paallen@xxxxxxxxxxxxx ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@xxxxxxxxxxxxxx |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: getting integer info.: 00237, Jeff Deroshia |
|---|---|
| Next by Date: | Re: Foriegn key to Union query or two tables: 00237, Bruno Wolff III |
| Previous by Thread: | getting integer info.i: 00237, Mark Molenda |
| Next by Thread: | Re: Foriegn key to Union query or two tables: 00237, Bruno Wolff III |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |