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

Re: Ordering not acting right.

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Blanco, Jose" <blancoj(at)umich(dot)edu>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Ordering not acting right.
Date: 2008-08-20 20:31:37
Message-ID: dcc563d10808201331q4100490ay2b26d9a63cc84540@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
On Wed, Aug 20, 2008 at 1:48 PM, Blanco, Jose <blancoj(at)umich(dot)edu> wrote:
> I have a text field which I use to store names ( lastname, firstname )
> and suppose we have the following 3 authors in the field:
>   ta, a
>   ta, z
>   tab, a
>
> I would expect them to show up in the order shown above when I select
> this field and order it by it, but instead I get:
>
>   ta, a
>   tab, a
>   ta, z
>
> Some one has suggested that this may have to do with my locale setting.
> I'm not an administrator so I'm not sure what how to check for the
> locale setting or what to change it to.  Does any one have any
> suggestions?
>
> I'm using postgres 8.1.11.

The best fix if you want ascii ordering is to re-initdb your db with
locale=C and then reload your data.

There's some stuff you can do with varchar_pattern_ops, but I'm not
sure it will work for order by in your situation.

In response to

pgsql-admin by date

Next:From: Lennin CaroDate: 2008-08-20 20:36:34
Subject: Re: Ordering not acting right.
Previous:From: Blanco, JoseDate: 2008-08-20 20:27:32
Subject: Re: Ordering not acting right.

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