On Sep 23, 2013, at 6:19 PM, Jean-Marie CUAZ <jm.c...@orens.fr> wrote:

> -> no exception is raised to host langage Tcl for 2 rows not inserted because 
> a UNIQUE constraint is not respected
> -> partial execution : 2 rows are definitely deleted from the table ...(ouch 
> !)

Yep. Looks like it does exactly what it says on the tin: 

"When a UNIQUE constraint violation occurs, the REPLACE algorithm deletes 
pre-existing rows that are causing the constraint violation prior to inserting 
or updating the current row and the command continues executing normally. If a 
NOT NULL constraint violation occurs, the REPLACE conflict resolution replaces 
the NULL value with the default value for that column, or if the column has no 
default value, then the ABORT algorithm is used. If a CHECK constraint 
violation occurs, the REPLACE conflict resolution algorithm always works like 
ABORT."

http://www.sqlite.org/lang_conflict.html

Usually… with insight… 'replace' is rarely what one really wants.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to