On 8/21/2013 2:55 PM, Simon Slavin wrote:

On 21 Aug 2013, at 5:02pm, Igor Tandetnik <i...@tandetnik.org> wrote:

I imagine you'd still want to be able to put COLLATE clause on the column definition, as 
in "create table t (x collate NOCASE);". How is this supposed to work in your 
hypothetical new world?

It works the same as it does now, I think.

Precisely. So why would you want to invent a completely different mechanism, when you already have one and have to maintain it anyway?

 The COLLATE clause in that position isn't used for storing the value itself.  
It's used later on for when two values in that column are compared with 
one-another.

... or with values in some other column of some other table, or indeed with arbitrary expressions.

Collation is a property of the value, similar to type and affinity - it must 
be, to allow this kind of annotation. Along with other properties, collation 
then affects the behavior of operators acting on the value.

I'm going to let the SQLite experts argue over that one.  I don't think a 
COLLATE can be a property of a value.  If it was you could compare two 
different values with different collations.  Perhaps it's a property of an 
index component.

I was imprecise. Collation is a property of an expression. It can be determined, for every expression, at statement prepare time, from the syntax of the statement and the database schema. In that, it's similar to affinity, but not to type (which is in fact a property of the value: the same expression may evaluate to values of different types at different points in the statement's execution).
--
Igor Tandetnik

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

Reply via email to