Skip site navigation (1) Skip section navigation (2)

Re: C locale sort in src/tools/make_ctags - solved

From: "Nicolai Tufar" <ntufar(at)pisem(dot)net>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>,"'Peter Eisentraut'" <peter_e(at)gmx(dot)net>
Cc: "'Bruce Momjian'" <pgman(at)candle(dot)pha(dot)pa(dot)us>,<pgsql-patches(at)postgresql(dot)org>
Subject: Re: C locale sort in src/tools/make_ctags - solved
Date: 2004-02-02 21:25:30
Message-ID: 000101c3e9d3$28b13820$5400a8c0@ntufar (view raw or flat)
Thread:
Lists: 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(at)gmx(dot)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(at)sss(dot)pgh(dot)pa(dot)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(at)candle(dot)pha(dot)pa(dot)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


In response to

pgsql-patches by date

Next:From: Nicolai TufarDate: 2004-02-02 21:27:42
Subject: Re: C locale sort in src/tools/make_ctags - solved
Previous:From: Stephan SzaboDate: 2004-02-02 21:23:15
Subject: Re: fix memcpy() overlap

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group