![](/img/trans.png)
[英]PostgreSQL explicit not-null violation check happens before the check constraint?
[英]postgreSQL check constraint and null
我創建了一個表“ TEST”,並嘗試輸入一些數據,但是出現錯誤。 錯誤為ERROR:關系“ test”的新行違反了檢查約束“ test_status_check”詳細信息:失敗行包含(5,2015-07-21,15:00:00,I7,9,NULL,NULL)。 我認為這是因為地位無效。 因此,我嘗試在測試表中放入null,但仍然無法正常工作
Create table test(
clientID CHAR (20),
startDate date,
startTime time,
instructorNO CHAR(20),
centreID CHAR(20),
status CHAR(4) CHECK (status IN ('Fail','Pass')) NULL,
reason VARCHAR(400),
omitted...
)
錯誤:關系“ test”的新行違反了檢查約束“ test_status_check”詳細信息:失敗行包含(5,2015-07-21,15:00:00,I7,9,NULL,NULL)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.