Re: [SQL ] postgresql 複合主鍵無法被外鍵參考?

看板Database作者 (薛丁格的貓)時間17年前 (2008/10/30 21:15), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/3 (看更多)
※ 引述《Bambe (肥兒)》之銘言: : 有試過pkey不constraint直接 primary key ("Pkey1","Pkey2") : 還是一樣無法被 slave 資料表參考... : 還有 slave 資料表直接在欄位後面接 reference 也不行QQ : 還是一樣一直出現42830的錯誤... Orz create table tb_master( "Pkey1" int not null , "Pkey2" int not null, "Pkey3" int not null, primary key ("Pkey1","Pkey2") ); create table tb_slave( "Pkey1" int not null, "Pkey2" int not null, CONSTRAINT "Ref_17" FOREIGN KEY ("Pkey1", "Pkey2") REFERENCES "tb_master"("Pkey1", "Pkey2") ) winXP postgreSql 8.2 很正常... ... 完全沒有 error -- Live Long and Prosper -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.217.33.143
文章代碼(AID): #192RDo6j (Database)
文章代碼(AID): #192RDo6j (Database)