This is because foreign key constraints typically reference primary keys, and changing a primary key that is referenced elsewhere causes trouble or unnecessary work. You are well advised to choose a primary key that is not only unique, but also never changes during the lifetime of a table row. If you wonder why, search the internet for the thousands of questions asking for help with removing duplicate entries from a table. In a relational database, it is important to be able to identify an individual table row. Why auto-generated primary keys?Įvery table needs a primary key. In this article, I’ll explore the options and give recommendations. ![]() ![]() UPDATED : Sometimes customers ask me about the best choice for auto-generated primary keys. Auto-generated auto-increment autoincrement identity columns postgresql primary key sequence uuid
0 Comments
Leave a Reply. |