SQLite Forum

How to handle collation version changes
Login
Thanks, Keith! REINDEX sounds like exactly what I'm looking for here.

Just to confirm a couple of details:

> There is a command to test the integrity of an index:

> PRAGMA INTEGRITY_CHECK;

Compared to PRAGMA integrity_check, does PRAGMA quick_check skip checking the validity of the sort order per the collation? (Is skipping this step one of the things that makes it "quick"?)

> They have to hold for the duration of the existence of the index which 
uses that collation.

I assume "index" here also includes "table" (if using a collation directly); is that correct?

> A collation can change at any time that it is not in use.

> ...

> Yes, there is a command for that.

> REINDEX

I think this means that it's OK for a collation to change if and only if the very first thing done with the new collation is a REINDEX command - the data affected by this collation must not be queried or modified with the new collation before that command completes. I think it also means that it's OK for the collation to change completely - for example, it could even be backwards or otherwise entirely different from before - as long as the very first thing done with the DB file after loading the new collation is to issue the REINDEX command. And for the REINDEX command, the old version of the collation is not needed/completely irrelevant - it just needs to have the new version loaded. Is that understanding all correct?

Thanks,

David