SQLite version 3.5.4
sqlite> create virtual table foo using fts3(content, id primary key);
sqlite> insert or replace into foo values('anything', 1);
sqlite> insert or replace into foo values('anything', 1);
sqlite> insert or replace into foo values('anything else', 1);
sqlite> select * from foo;
anything|1
anything|1
anything else|1

For comparison's sake:

SQLite version 3.5.4
Enter ".help" for instructions
sqlite> create table foo (content, id primary key);
sqlite> insert or replace into foo values('anything', 1);
sqlite> insert or replace into foo values('anything', 1);
sqlite> insert or replace into foo values('anything else', 1);
sqlite> select * from foo;
anything else|1

Why doesn't inserting a row with a duplicate primary key trigger a conflict? 
Is this part of fts3's design, or is it an oversight?  Am I missing something?

For now, I will avoid this problem by deleting rows matching the primary key
before inserting/replacing them.

-- 
Andy Goth
<[EMAIL PROTECTED]>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to