Foreign key refering to primary keys across multiple tables?
Posted
by sanjay bharkatiya
on Stack Overflow
See other posts from Stack Overflow
or by sanjay bharkatiya
Published on 2010-05-29T05:56:28Z
Indexed on
2010/05/29
6:02 UTC
Read the original article
Hit count: 297
postgresql
hi , i have three tables say city,state and road
1) city -> city_id(PK),name
2) state-> Stt_id(PK),name
3) Road-> Edge_id(PK), Admin_id(FK)
where Admin_id refers to city_id and Stt_id both.
This is done because the tables are too huge.
say city_id contains 1,2,3 and Stt_id contains 4,5,6
now if i am inserting 1,2,3,4,5,6 in admin_id it is throuing an error .. what is the solution of my problem,
regards
sanjay
© Stack Overflow or respective owner