I want to avoid duplicates in a simple SpatiaLite database with 2 spatial tables and non-unique coordinates. For each table I've created a TEXT NOT NULL UNIQUE column for an identifier. One table has a 14 character identifier and it works fine but the 2nd table has a 51 character identifier and the text gets corrupted to 6 unprintable characters. After much trial and error I've determined that I have to limit these identifiers to 15 characters. Between 16 and 22 characters I get a "UNIQUE constraint failed" error. Above 22 characters I get the corruption described above and only occassionally the constraint failure. Colleagues and I have searched and found no documentation on any such limit particular to TEXT NOT NULL UNIQUE columns, with or without the SpatiaLite extensions. So what is this?
- A bug in SQLite or SpatiaLite?
- A known 15 character limit for TEXT NOT NULL UNIQUE columns?
- A bad assumption on my part somewhere?
I'm using:
- SQLite version: 3.22.0
- SpatiaLite version: 4.3.0a