Re: C locale sort in src/tools/make_ctags - solved - Mailing list pgsql-patches

From Nicolai Tufar
Subject Re: C locale sort in src/tools/make_ctags - solved
Date
Msg-id 000101c3e9d3$28b13820$5400a8c0@ntufar
Whole thread Raw
In response to Re: C locale sort in src/tools/make_ctags  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Thanks to Peter Eisentraut, Bruce Momjian and Tom Lane.
With the second CVS commit by Bruce Momjian it works fine now.

Peter Eisentraut <peter_e@gmx.net> wrote:
> > 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 stand corrected.

Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 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.
      [...]
> 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

In my environment everything but LANG is set to tr_TR:
$ locale
LANG=tr_TR
LC_CTYPE="tr_TR"
LC_NUMERIC="tr_TR"
LC_TIME="tr_TR"
LC_COLLATE="tr_TR"
LC_MONETARY="tr_TR"
LC_MESSAGES="tr_TR"
LC_PAPER="tr_TR"
LC_NAME="tr_TR"
LC_ADDRESS="tr_TR"
LC_TELEPHONE="tr_TR"
LC_MEASUREMENT="tr_TR"
LC_IDENTIFICATION="tr_TR"
LC_ALL=
$

Method you suggested:
    LC_COLLATE=C
    export LC_COLLATE
works fine too.

Bruce Momjian <pgman@candle.pha.pa.us> wrote:
>
> OK, new code is:
>
>     LC_ALL=C
>    export LC_ALL
>    sort tags >/tmp/$$ && mv /tmp/$$ tags

It works as expected. Thanks a lot.

Best regards,
Nicolai Tufar


pgsql-patches by date:

Previous
From: "Nicolai Tufar"
Date:
Subject: Re: C locale sort in src/tools/make_ctags - solved
Next
From: Stephan Szabo
Date:
Subject: Re: fix memcpy() overlap