Обсуждение: Collation Order Change

Поиск
Список
Период
Сортировка

Collation Order Change

От
"Len Morgan"
Дата:
I made the mistake of doing a rather "large" upgrade to my application (new
hardware, new version of the OS, latest Postgresql, etc) and it has not
worked right since.  The problem is that the sort order has changed on text
fields.  The archives mentioned an i18n or something like that file that
determined the local order but I didn't see how to apply that information to
my situation.  My before and afters are:

Before:
Postgres: 7.0
OS: RH 7.0

After:
Postgres: 7.2
OS: RH 7.2

The problem shows up in names that contain more than one word.  It seems
that the "new" alphabetical order doesn't look at spaces or dashes when
deciding on order.  For example:

De La Rosa-Acosta
De La Rosa-Asente
Delarosa-Garcia
De La Rosa-Mendez
....

The third name should be after all of the "De La Rosa"s which it was on the
old system.  What do I need to do to change this back to the "correct"
sorting order?  I made it by last months billing by dragging out the old
hardware/software but that won't work any more.

Thanks

Len Morgan





Re: Collation Order Change

От
Tom Lane
Дата:
"Len Morgan" <len-morgan@crcom.net> writes:
> The problem shows up in names that contain more than one word.  It seems
> that the "new" alphabetical order doesn't look at spaces or dashes when
> deciding on order.  For example:

Sounds like you have selected a non-C locale (most likely en_US, which
is the system default in recent RH releases).  Unfortunately the only
way to change PG's locale is a fresh initdb :-(.  Try

    export LANG=C
    locale        --- make sure it says "C" for everything
    initdb

            regards, tom lane