Re: Sort order confusion

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Sort order confusion
Date: 2004-02-09 18:20:30
Message-ID: 200402091020.30916.scrawford@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday 05 February 2004 6:08 pm, Tom Lane wrote:
> Steve Crawford <scrawford(at)pinpointresearch(dot)com> writes:
> > Not exactly. I _DO_ want it in ASCII character set order which
> > includes spaces (0x20) sorting ahead of digits (0x30 - 0x39).
> > This is not what is happening. The first sort is some SQL sort
> > order that seems to ignore certain characters.
>
> Sounds to me like you've got the database in a non-C locale. See
> past discussions ...

That was my first inclination (as noted in the full version of my
original post - now lost to the thread) but my installation history
showed:
initdb -d --locale=C -D /var/lib/pgsql/data

Nonetheless pg_controldata shows:
LC_COLLATE: en_US
LC_CTYPE: en_US

I now suspect that currently active "real" database was in-fact
created not by my several test initializations but by the SuSE
startup script which will run an "initdb" if the database has not
been initialized and which reads /etc/sysconfig/language to get
default locale settings.

So...

Is there a method of changing the locale of an extant database or do I
need to dump ; delete db ; reinit ; restore ?

Cheers,
Steve

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-02-09 18:30:00 Re: Where do I find the init-script
Previous Message Tom Lane 2004-02-09 18:04:37 Re: Increasing Max Connections Mac OS 10.3