On Mon, Aug 26, 2013 at 2:03 PM, Roman Fleysher
<roman.fleys...@einstein.yu.edu> wrote:

Certainly associating a type conversion with a lexical instance of an
operator, applying to all of the operator's operands (or perhaps even
just to some, while having to explicitly cast others) would work, at
least for operations which can only be accessed via the given
syntactic operator.  But while some implicit type conversions are
useful and handy, I don't think *collations* can be implied, really,
at least not if there are no constant literals around (and we have no
syntax for associating collations with those!)...

Now, perhaps for most operators we can't easily pick one operand to
supply type information for implicit casting of the other(s), but for
BETWEEN you might argue that the type of the first operand should be
used to inform type conversion of the second and third operands.  That
would work, and it'd be easy to remember even.  But conceptually even
then the collation is best thought of as an attribute of types.  For
string values changing their collation is easy, thankfully: it's just
an attribute of the string.  And most systems don't keep track of
collations (or lots of other info) associated with specific strings --
this includes SQLite, IIRC.  In such systems one workaround for the
lack of compile- and/or run-time sting collation information... would
be to specify the collation syntactically.  So you have a point, but I
think the point really is that an RDBMS should keep track of column
and string collations so as to avoid having to require lexical clues
for collation.

Of course, lacking a syntax for associating collations with string
literals there will be times when some, or even all of the operands to
an operation that needs collation information, is missing.  In such
cases the collation information of some operands could be used to cast
the others, or lexical clues might be needed, or a default might be
provided.

So, in short, I think you and James are both right, and maybe we're
squaring a circle.  But still, notionally I'm with James on this:
collation is an attribute of type.

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

Reply via email to