What is the purpose of constraint naming

后端 未结 7 1200
栀梦
栀梦 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:28

    To identify the constraint in the future (e.g. you want to drop it in the future), it should have a unique name. If you don't specify a name for it, the database engine will probably assign a weird name (e.g. containing random stuff to ensure uniqueness) for you.

    0 讨论(0)
提交回复
热议问题