ADQL and ORDER BY

Patrick Dowler pdowler.cadc at gmail.com
Wed Feb 24 22:33:49 CET 2021


I have just discovered (to my horror) that some of our databases sort in
different order than others depending on the LC_COLLATE value...
specifically thus is noticeable with underscore which comes before letters
with C but after letters with en_CA or en_US... ouch.

Does ADQL specify this? Which locale (?) is assumed to be correct for ADQL?


gory details:

in java, underscore comes before letters:
groovy:000> "FOO_bar".compareTo("FOObar");
===> -3
groovy:000> "FOObar".compareTo("FOO_bar");
===> 3
so java is equiv to C even when system locale is en_CA

In PG server 1:
cvomaqdb=> show lc_collate;
 lc_collate
-------------
 en_US.UTF-8

cvomaqdb=> select 'FOO_bar' < 'FOObar';
 f

cvomaqdb=> select 'FOObar' < 'FOO_bar';
 t

In PG server 2:
content=> show lc_collate;
 lc_collate
------------
 C

content=> select 'FOO_bar' < 'FOObar';
 t

content=> select 'FOObar' < 'FOO_bar';
 f


--
Patrick Dowler
Canadian Astronomy Data Centre
Victoria, BC, Canada
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ivoa.net/pipermail/dal/attachments/20210224/ab02d306/attachment.html>


More information about the dal mailing list