What's the reason why Django has SmallIntegerField?

后端 未结 2 1722
Happy的楠姐
Happy的楠姐 2021-02-11 14:52

I\'m wonder why it\'s provided. The field is database dependent, doesn\'t that make it totally unreliable to use?

I want to store birth year in a model, kinda like

2条回答
  •  自闭症患者
    2021-02-11 15:10

    It's not totally unreliable. SMALLINT is part of the SQL standard and certainly MySQL and PostgreSQL both have small integer types that go from -32768 to +32767

提交回复
热议问题