pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: Blanco, Jose <blancoj@umich.edu>
Cc: pgsql-admin@postgresql.org
Subject: Re: Ordering not acting right.
Date: Wed, 20 Aug 2008 14:31:37 -0600
Message-ID: <dcc563d10808201331q4100490ay2b26d9a63cc84540@mail.gmail.com> (raw)
In-Reply-To: <E0217C87D1BA1043AC897ACFA468CEE6022EF9A8@ECLUST2-VS3.adsroot.itcs.umich.edu>
References: <E0217C87D1BA1043AC897ACFA468CEE6022EF9A8@ECLUST2-VS3.adsroot.itcs.umich.edu>

On Wed, Aug 20, 2008 at 1:48 PM, Blanco, Jose <blancoj@umich.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.



view thread (6+ messages)  latest in thread

Message-ID: <dcc563d10808201331q4100490ay2b26d9a63cc84540@mail.gmail.com>
Permalink:  ../dcc563d10808201331q4100490ay2b26d9a63cc84540@mail.gmail.com/
Also on:    postgresql.org/message-id/dcc563d10808201331q4100490ay2b26d9a63cc84540@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: scott.marlowe@gmail.com, blancoj@umich.edu
  Subject: Re: Ordering not acting right.
  In-Reply-To: <dcc563d10808201331q4100490ay2b26d9a63cc84540@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox