insert "where True" (without the quotes) between the table name and the on conflict clause. The keyword "on" following a tablename in a select statement is the introducer for a parenthetical where condition clause (as in FROM x JOIN y ON shishkabobs=delicious) and conflict(...) becomes a function call, and DO becomes a syntax error. You need to terminate the select statement parsing so that ON is parsed as belonging to the INSERT rather than the SELECT. ``` INSERT INTO pathway SELECT pathold._rowid_, pathold._shape, pathold.vehicle_id, pathold.begin_time, pathold.end_time, pathold.area, pathold.rect, pathold.block_id, pathold.layer_index FROM pathold WHERE True on conflict(vehicle_id,begin_time) DO NOTHING; ``` This is a known parsing issue with INSERT ... SELECT ... ON CONFLICT ... <https://sqlite.org/lang_UPSERT.html>