Neither {{pragma integrity_check}} nor {{pragma foreign_check_check}}
checks CHECK constraints.

Given that there's {{pragma ignore_check_constraints = 1}} which allows to
bypass CHECK constraints, that seems like a surprising oversight.

I even tried {{pragma ignore_check_constraints = 0}} in case it was
re-validate CHECK constraint on that mode change, but apparently not.

Could we please have a new {{pragma check_constraints_check}} pragma,
or alternatively have {{pragma integrity_check}} actually check CHECK
constraint?

Thanks, --DD

PS: Also note that {{pragma integrity_check}} (or quick_check) and {{pragma
foreign_check_check}} differ in behavior, one return ok, the other nothing.
Ideally they'd be consistent.

C:\Users\ddevienne>sqlite3
SQLite version 3.10.2 2016-01-20 15:27:19
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> create table t (v CHECK (typeof(v) = 'integer'));
sqlite> insert into t values (1);
sqlite> insert into t values ('two');
Error: CHECK constraint failed: t
sqlite> pragma ignore_check_constraints = 1;
sqlite> insert into t values ('two');
sqlite> pragma integrity_check;
ok
sqlite> pragma foreign_key_check;
sqlite> pragma ignore_check_constraints = 0;
sqlite> pragma quick_check;
ok
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to