I seem to be getting a foreign key check anomaly.  I've checked the constraint 
mentioned in the error message (and the other one, just in case).  Am I 
overlooking something, or has this been fixed since 3.8.4.1?  

sqlite> pragma foreign_key_check;
Error: foreign key mismatch - "Field" referencing "Segm"

sqlite> pragma foreign_key_list(Field);
id          seq         table       from        to          on_update   
on_delete   match     
----------  ----------  ----------  ----------  ----------  ----------  
----------  ----------
0           0           Segm        SegName     Name        NO ACTION   NO 
ACTION   NONE      
0           1           Segm        DbdName     DbdName     NO ACTION   NO 
ACTION   NONE      
1           0           Datatypes   Datatype    Name        NO ACTION   NO 
ACTION   NONE      

sqlite> select count(*) from Field as f 
        where not exists (
          select 1 from Segm 
          where Name = f.SegName 
          and DbdName = f.DbdName);
count(*)  
----------
0     

In case it's interesting, the FK declaration in the CREATE TABLE for Field is   
  

       , foreign key (SegName, DbdName) references
                    Segm(Name, DbdName)

--jkl

Reply via email to