我正在尝试向表添加检查约束,例如
ALTER TABLE foo ADD CONSTRAINT bar CHECK (...);
我得到错误:
ERROR: check constraint "bar" is violated by some row
********** Error **********
ERROR: check constraint "bar" is violated by some row
SQL state: 23514
有没有办法让postgres(9.6)告诉我它在哪一行失败?这会很有帮助。
确定。
Select * from bar where <desired check constraint>;