Mark Wagner wrote:
> The documentation for foreign_key_check says I should be receiving 4
> columns per violation.  I only seem to be getting 1.
>
> CREATE TABLE t (id int primary key, value);
> CREATE TABLE t1 (id integer primary key, v references t(value));
> sqlite> pragma foreign_key_check;
> Error: foreign key mismatch - "t1" referencing "t"

The PRAGMA does not even run; you are not getting any result.

The problem is that there is no valid foreign key constraint;
<http://www.sqlite.org/foreignkeys.html#fk_indexes> says:
| Usually, the parent key of a foreign key constraint is the primary key
| of the parent table. If they are not the primary key, then the parent
| key columns must be collectively subject to a UNIQUE constraint or
| have a UNIQUE index.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to