Re: Very puzzling sort behavior - Mailing list pgsql-general

From Peter Geoghegan
Subject Re: Very puzzling sort behavior
Date
Msg-id CAEYLb_W9A7RKeHBjbfF7E64C=t539jhRpdiyEUp3x-mqEvmDsQ@mail.gmail.com
Whole thread Raw
In response to Very puzzling sort behavior  (Ken Tanzer <ken.tanzer@gmail.com>)
Responses Re: Very puzzling sort behavior
List pgsql-general
On Thu, Sep 10, 2015 at 12:51 PM, Ken Tanzer <ken.tanzer@gmail.com> wrote:
> OK, can one of you help me out in understanding this?  I would have thought that given "CLARK," and "CLARKE" that the
commawould get compared against the E and come first.  End of story, before we even get to anything farther in the
string. What am I missing? 

That's only how it works with the C locale. Otherwise, there are
complicated rules to weigh things like space and punctuation (and
accents/diacritics) less prominently than primary alphabetical
ordering. This is often useful. Anyway, based on what you say here, I
think you should actually "ORDER BY name_last, name_first".

--
Regards,
Peter Geoghegan


pgsql-general by date:

Previous
From: Ken Tanzer
Date:
Subject: Re: Very puzzling sort behavior
Next
From: Ken Tanzer
Date:
Subject: Re: Very puzzling sort behavior