On Sun, 12 Jan 2020 16:24:53 -0700
"Keith Medcalf" <kmedc...@dessus.com> wrote:

> while one may be tempted to claim that "consistency is the hobgoblin
> of little minds" 

You might have forgotten that the much overpraised Ralph Waldo specified
"a foolish consistency".  He only meant: don't try to hang your hat on
too small a peg.  

> Doing this does not really do much since you still have to check the
> type on retrieval of the value anyway in order to know what to do
> with it.

That depends what "much" is.  

The value of constraints used to enforce types is to reject from the
database values outside the domain.  That not only simplifies
application logic, but also the logical consistency of the queries
themselves.  

If "year" is always an integer -- never NULL, never a string -- then 

        avg(year) 
and
        count(year) 

are always correct.  But if the database contains for "year" a string
like "it was a good one", or NULLs, they're both unreliable.  

--jkl
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to