i m using postgresql... i want one of my columns to reference diff tables and refernece them in or relation wat i mean is
that for the column foo in table foo_table the values should come from column ref1 in table 1 orref 2 in table 2 and so on
eg in foo_table id foo 1 123 (referneces table1) 2 124 (referneces table1) 3 223 (referneces table 2)
table 1 id ref1 otherfields id01 123 kasdhfaks id02 124 asdkjasl
table2 id ref2 02id01 223
so is there anyway i can specify these constraints
i hope i was clear in the description...
thanks -- Puneet
On 30/01/06 00:43 +0530, Puneet Lakhina wrote:
i m using postgresql... i want one of my columns to reference diff tables and refernece them in or relation wat i mean is
Please write in English.
that for the column foo in table foo_table the values should come from column ref1 in table 1 orref 2 in table 2 and so on
eg in foo_table id foo 1 123 (referneces table1) 2 124 (referneces table1) 3 223 (referneces table 2)
table 1 id ref1 otherfields id01 123 kasdhfaks id02 124 asdkjasl
table2 id ref2 02id01 223
so is there anyway i can specify these constraints
Use an explicit constraint check, or a trigger. Foreign keys will not work.
Devdas Bhagat
2006/1/30, Devdas Bhagat devdas@dvb.homelinux.org:
On 30/01/06 00:43 +0530, Puneet Lakhina wrote:
i m using postgresql... i want one of my columns to reference diff
tables
and refernece them in or relation wat i mean is
Please write in English.
The or should have been OR.. as in a OR b OR c... Sorry for the trouble
that for the column foo in table foo_table the values should come from
column ref1 in table 1 orref 2 in table 2 and so on
eg in foo_table id foo 1 123 (referneces table1) 2 124 (referneces table1) 3 223 (referneces table 2)
table 1 id ref1 otherfields id01 123 kasdhfaks id02 124 asdkjasl
table2 id ref2 02id01 223
so is there anyway i can specify these constraints
Use an explicit constraint check, or a trigger. Foreign keys will not work.
Devdas Bhagat
-- Puneet