PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹5. 昄扞垔幬媆誕嬉誕

5.11. 冺蕡攓虘詻

套悩嘹录傺庖婔婻寙劆螩崔臘幽婫婥橬崡髞亥溘㔕蓖商㔕蓥埏単㔕庘昄京崉溗䔇昄扞康䂷悇㔗闼幽嘹儌嚔婘凹茇幋閘锊劆婄录傺庖婔婻冺蕡攓䔇䘏䂩㔗懫套婔婻婥橬崡髞亥溘䔇臘冺蕡庯垄欔嚘䫘䔇臘㔗

婺庖媺臕昘婻昄扞康䂷悇䔇垯昘攓PostgreSQL 媺臕嘹方濘役鍴闼底誻赆噽垄凹茇冺蕡䔇凹茇㔗懫套臘商役鍴婘誗5.3.5麯赆螵剘臘欔冺蕡䔇库巕臘滇婉脘潊媘䔇嚔橬䌂嚚婋麵䔇髍臇媇敇庺䯄

DROP TABLE products;

NOTICE:  constraint orders_product_no_fkey on table orders depends on table products
ERROR:  cannot drop table products because other objects depend on it
HINT:  Use DROP ... CASCADE to drop the dependent objects too.

認婻髍臇媇敇寙劆婔婻橬䫘䔇柊䴺套悩嘹婉愿麂䄥䔇彖彆役鍴欔橬冺蕡凹茇嘹埇傖誊臯

DROP TABLE products CASCADE;

䇽劯欔橬赆冺蕡䔇凹茇鄘儖赆役鍴(幽婉役鍴螵剘臘埻滇役鍴崡髞亥溘)㔗套悩嘹愿演昖 DROP ... CASCADE 嚔幾傔幽誊臯婉婥 CASCADEDROP 䇽劯黙臂 NOTICE 媇敇㔗

PostgreSQL 麯䔇欔橬役鍴变傴鄘櫇毕弄滯 CASCADE 㔗嘷䇽噙嘷䔇冺蕡攓垂嘷埡喿庯凹茇䔇䌂傋㔗嘹幘埇傖喍 RESTRICT 蔯婉滇 CASCADE 傖诙埡䚺䩕䔇臯婺(備鍊庯役鍴闼底噽垄凹茇欔冺蕡䔇凹茇)㔗

㔊濘懟㔏湹扞 SQL 湺庖襕挗躿儏弄滯 RESTRICTCASCADE 婺䔇婔婻㔗垂鍙婪澇橬巻䓉昄扞康係䂘嚺彽認婔䗹嘖滇䚺䩕䔇臯婺滇 RESTRICT 誻滇 CASCADE 彍啹係䂘蔯嚗㔗

㔊濘懟㔏婘 PostgreSQL 7.3幋嬉䔇崡髞亥溘冺蕡攓启废彖庖枕冺蕡攓婘剺亓誺䘋婺鄘婉嚔冖彄䂘檴潡蔙录傺㔗欔橬噽垄䔇冺蕡攓䌂傋 婘傯7.3䬽橸傖嬉䔇昄扞康剺亓誺䘋婺鄘儖冖彄敄嘷䔇录傺㔗


劯锔饡釕嬉誕
噽垄昄扞康凹茇婪婔亓昄扞淉嘩