SQLite Forum

use of "notnull" and "unique" in column names
Some genius decided to name one of the columns returned by pragma_table_info as "notnull" which is a reserved key word in SQLite3.  Similarly, pragma_index_list returns a column named "unique" which is also a reserved key word.

When I explicitly listed those two column names (unquoted) in SELECT requests from C code, I got "out of memory" failures, which implies a serious problem with the SQL parser.  It would be nice if somebody could fix the parser to at least diagnose the situation rather than run out of memory! (That's the "hard" part of my request.)

In the meantime, all documentation of those two table functions (as well as the related pragma_table_xinfo) should be modified to have warnings to the naive reader that those two column names MUST be quoted to be successfully used as column names!  I doubt there are many places on the SQLite website that mention those table functions, so it shouldn't be very hard to find them.  (That's the "easy" part of my request.)

It wouldn't hurt to check whether any other SQLite built-in column names similarly conflict with reserved keywords.  I just happened upon these two.