What is the purpose of constraint naming

后端 未结 7 1424
栀梦
栀梦 2020-11-28 05:33

What is the purpose of naming your constraints (unique, primary key, foreign key)?

Say I have a table which is using natural keys as a primary key:

C         


        
7条回答
  •  独厮守ぢ
    2020-11-28 06:17

    When your code randomly violates some foreign key constraint, it sure as hell saves time on debugging to figure out which one it was. Naming them greatly simplifies debugging your inserts and your updates.

提交回复
热议问题