On Wed Aug 14, 2019 at 09:08:26PM +0800, Adrian Ho wrote: > On 14/8/19 8:47 PM, no...@null.net wrote: > > > > CREATE TABLE table_a( > > dt TEXT -- NOT NULL if you like > > CONSTRAINT valid_date CHECK(dt IS date(dt,'localtime')) > > ); > > Sorry, that 'localtime' qualifier is a non-starter; that will throw a > "non-deterministic function in index expression or CHECK constraint" > error > (https://www.sqlite.org/deterministic.html#special_case_processing_for_date_time_functions):
Right you are. I should have checked that properly. Looks like '+0 days' is the right way to go then, still using the IS operator to handle NULLs. -- Mark Lawrence _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users