Re: C locale sort in src/tools/make_ctags

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: C locale sort in src/tools/make_ctags
Дата
Msg-id 9387.1075734363@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: C locale sort in src/tools/make_ctags  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: C locale sort in src/tools/make_ctags  (Peter Eisentraut <peter_e@gmx.net>)
Re: C locale sort in src/tools/make_ctags - solved  ("Nicolai Tufar" <ntufar@pisem.net>)
Список pgsql-patches
Peter Eisentraut <peter_e@gmx.net> writes:
> Nicolai Tufar wrote:
>> Don't do it! I just tried it with only LC_ALL and it did not
>> work. Same "tags file is not sorted" error message from vi.

> On second look, the patch is completely wrong anyway, because it does
> not export the variables; it depends on the user having exported them
> beforehand.

I saw that, but it seemed a non-problem to me: if the variables have not
been exported then they won't affect the sort program anyway.

I tried to reproduce Nicolai's statement about LC_ALL not being
sufficient, but AFAICT Fedora Core 1 handles this as expected:

$ cat /etc/redhat-release
Fedora Core release 1 (Yarrow)
$ LANG=en_US LC_ALL=en_GB locale
LANG=en_US
LC_CTYPE="en_GB"
LC_NUMERIC="en_GB"
LC_TIME="en_GB"
LC_COLLATE="en_GB"
LC_MONETARY="en_GB"
LC_MESSAGES="en_GB"
LC_PAPER="en_GB"
LC_NAME="en_GB"
LC_ADDRESS="en_GB"
LC_TELEPHONE="en_GB"
LC_MEASUREMENT="en_GB"
LC_IDENTIFICATION="en_GB"
LC_ALL=en_GB
$ cat zzz
abc DEF
ABC DEF
$ LANG=C sort zzz
ABC DEF
abc DEF
$ LANG=en_US sort zzz
abc DEF
ABC DEF
$ LANG=en_US LC_ALL=C sort zzz
ABC DEF
abc DEF


What I suspect is that Nicolai's environment supplies an explicit value
for LC_COLLATE, overriding both LC_ALL and LANG.  If we want to be
bulletproof against that, then none of the proposals in this thread are
correct, and the correct patch is

+ LC_COLLATE=C
+ export LC_COLLATE


            regards, tom lane

В списке pgsql-patches по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: CATALOG/NOCATALOG for new users
Следующее
От: David Fetter
Дата:
Сообщение: Re: Patch for psql startup clarity