What's the point of “NOT NULL DEFAULT '' ”?

后端 未结 7 861
时光说笑
时光说笑 2021-02-01 05:10

I\'ve seen this on a lot of fields on a DB from a project I\'ve been working on, where a column will be defined not null, but will have an empty string as the default. what\'s t

7条回答
  •  庸人自扰
    2021-02-01 05:45

    In addition to what @Piskvor mentioned, this practice is also there so as to prevent some potential NullPointerExceptions in the application logic when populating beans/objects etc. after reading from DB

提交回复
热议问题