Currently, if value of a primary key field conflicts with an existing value for that field in the table, then we add that row to the conflict rather than the main table. This is the right behaviour.
However if there is some other problem with a primary or unique key field (e.g., it has leading space), then the value of the field is inserted to the table as NULL. SQLite happily accepts this, but we will likely run into problems with Postgres.
We need to insert all rows with invalid unique or primary key fields to their corresponding conflict table, not just rows with non-unique values.
Currently, if value of a primary key field conflicts with an existing value for that field in the table, then we add that row to the conflict rather than the main table. This is the right behaviour.
However if there is some other problem with a primary or unique key field (e.g., it has leading space), then the value of the field is inserted to the table as NULL. SQLite happily accepts this, but we will likely run into problems with Postgres.
We need to insert all rows with invalid unique or primary key fields to their corresponding conflict table, not just rows with non-unique values.