SQLite Forum

How to not to overwrite a row if the key exists?
Login
Yes, you can apparently specify something ludicrous like:

REPLACE INTO x VALUES (...) ON CONFLICT DO NOTHING;  
which is of course an alternate spelling for  
INSERT or REPLACE INTO x VALUES (...) ON CONFLICT DO NOTHING;  

and indeed the "last seen" conflict resolution method (ON CONFLICT) overrides the prior resolution method (or REPLACE).  Though I don't really understand why you would do that -- it seems rather foolish to me.

I can see perhaps favouring the use of:
INSERT INTO x VALUES (...) ON CONFLICT DO NOTHING;  
over the more succinct  
INSERT or IGNORE INTO x VALUES (...);  
because one prefers using ON CONFLICT resolution clauses rather than the "or IGNORE" clause, however the ON CONFLICT clause does not (and cannot) equate to the "or REPLACE"/"or ROLLBACK"/"or ABORT"/"or FAIL" clauses.

That is, "INSERT or REPLACE" is not and never will be equivalent to any INSERT ... ON CONFLICT UPDATE ... because they behave entirely differently.  One does an UPDATE when a matching conflict is found, the other DELETEs conflicting rows and does an insert, which are entirely different things.  In some narrowly defined and specific implementations with very particular database schema constructions they made achieve the same result, but that is only by happenstance and sheer luck.