Re: varchar sort ordering ignore blanks

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Luca Arzeni <l(dot)arzeni(at)amadego(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: varchar sort ordering ignore blanks
Date: 2008-01-16 13:43:49
Message-ID: 1200491029.31152.15.camel@PCD12478
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2008-01-15 at 16:32 +0100, Luca Arzeni wrote:
> In all cases I'm using locale LATIN9 during DB creation, but I tested also
> with ASCII, UTF8 and LATIN1 encoding.

I guess this has nothing to do with the encoding, but with the collation
rules used, which is governed by "lc_collate" parameter. See what you
get on both DBs for:

SHOW lc_collate ;

Quoting from the docs:

"The nature of some locale categories is that their value has to be
fixed for the lifetime of a database cluster. That is, once initdb has
run, you cannot change them anymore. LC_COLLATE and LC_CTYPE are those
categories. They affect the sort order of indexes, so they must be kept
fixed, or indexes on text columns will become corrupt. PostgreSQL
enforces this by recording the values of LC_COLLATE and LC_CTYPE that
are seen by initdb. The server automatically adopts those two values
when it is started."

See:
http://www.postgresql.org/docs/8.1/static/charset.html

HTH,
Csaba.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2008-01-16 13:47:28 Re: COUNT() with ORDER BY
Previous Message Martijn van Oosterhout 2008-01-16 13:42:36 Re: Help with pre-loaded arbitrary key sequences