PRAGMA case_sensitive_like
deprecated
The default behavior of the LIKE operator is to ignore case for ASCII characters.
PRAGMA case_sensitive_like = boolean;
What the SQLite documentation says
The default behavior of the LIKE operator is to ignore case for ASCII characters. Hence, by default 'a' LIKE 'A' is true. The case_sensitive_like pragma installs a new application-defined LIKE function that is either case sensitive or insensitive depending on the value of the case_sensitive_like pragma. When case_sensitive_like is disabled, the default LIKE behavior is expressed. When case_sensitive_like is enabled, case becomes significant. So, for example, 'a' LIKE 'A' is false but 'a' LIKE 'a' is still true.
This pragma uses sqlite3_create_function() to overload the LIKE and GLOB functions, which may override previous implementations of LIKE and GLOB registered by the application. This pragma only changes the behavior of the SQL LIKE operator. It does not change the behavior of the sqlite3_strlike() C-language interface, which is always case insensitive.
WARNING: If a database uses the LIKE operator anywhere in the schema, such as in a CHECK constraint or in an expression index or in the WHERE clause of a partial index, then changing the definition of the LIKE operator using this PRAGMA can cause the database to appear to be corrupt. PRAGMA integrity_check will report errors. The database is not really corrupt in that changing the behavior of LIKE back to the way it was when the schema was defined and the database was populated will clear the problem. If the use of LIKE occurs only in indexes, then the problem can be cleared by running REINDEX. Nevertheless, the use of the case_sensitive_like pragma is discouraged.
WARNING:ALTER TABLE might report an error rather than perform the requested alteration if this pragma is enabled and the requested alteration involves an index that uses the LIKE operator. We do not intend to fix that problem since this pragma is deprecated.
This pragma is deprecated and exists for backwards compatibility only. New applications should avoid using this pragma. Older applications should discontinue use of this pragma at the earliest opportunity. This pragma may be omitted from the build when SQLite is compiled using SQLITE_OMIT_DEPRECATED.
From sqlite.org's pragma documentation for SQLite 3.54.1, in the public domain.
← cache_spill · cell_size_check →