Should I design a table with a primary key of varchar or int?

后端 未结 13 1123
清酒与你
清酒与你 2020-11-27 13:45

I know this is subjective, but I\'d like to know peoples opinions and hopefully some best practices that I can apply when designing sql server table structures.

I pe

13条回答
  •  迷失自我
    2020-11-27 14:32

    With PostgreSQL I generally use the "Serial" or "BigSerial" 'data type' for generating primary keys. The values are auto incremented and I always find integers to be easy to work with. They are essentially equivalent to a MySQL integer field that is set to "auto_increment".

提交回复
热议问题