[TAP] case sensitivity of query
Francois Ochsenbein
francois at vizier.u-strasbg.fr
Tue Mar 3 16:25:52 PST 2009
Just to emphasize on Tom's comments about SQL case sensitivity:
A + B. the language is defined as case insensitive ;
ADQL recommendation clearly specifies case
insensitivity (section 2.1.2).
C. table + column names: ADQL recommendation specifies
"ADQL allows making use of the quoting mechanism
to handle the case sensitiveness if needed"
A good practice would be, in my opinion, to
use the case of the catalog/schema/table/column
names as those are spelled in the VOResource or
in the TAP_SCHEMA (hopefully these 2 should be
identical!)
D. character variable as data: upper and lower case
differ, and there are also problems with the
latin extensions or the other alphabets. I didn't
see anything about ISO-8859 or other codes in SQL92
(not talking of unicode which did not exist :-)
It seems that SQL defines the "upper" and "lower"
functions (not mentioned in the ADQL document,
but listed as 'reserved words'), i.e. a caseless
equality is written as
upper(t1.col1)=upper(t2.col2)
About this last point (case sensitivity of strings)
postgres provides the 'ilike' operator (case-insensitive
like operator), and allows also the creation of
caseless indices (faster searches with ilike operator)
But it's not SQL-92 standard.
This brings up another motivation to add some definition of
the column domains into TAP_SCHEMA (only uppercase or only
lowercase strings represent a domain definition, as well
as restriction to 7-bit ascii characters).
Francois
=======================================================================
Francois Ochsenbein ------ Observatoire Astronomique de Strasbourg
11, rue de l'Universite 67000 STRASBOURG Phone: +33-(0)390 24 24 29
Email: francois at astro.u-strasbg.fr (France) Fax: +33-(0)390 24 24 17
=======================================================================
More information about the dal
mailing list