SQLite, ASCII Characters 0x20 to 0x7E Check Constraint I have the following table which I'm trying to limit the column name to ASCII characters ranging from 0x20 to 0x7E. Why is it not working?

CREATE TABLE test
(
    id INTEGER NOT NULL, 
    name TEXT NOT NULL CHECK(name NOT GLOB '*[^\x20-\x7E]*'),
    PRIMARY KEY(id)
)
In SQL, \ is not a special character.

You have to insert the characters directly:

CREATE TABLE test
(
    id INTEGER NOT NULL, 
    name TEXT NOT NULL CHECK(name NOT GLOB '*[^ -~]*'),
    PRIMARY KEY(id)
)