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

Re: Weird sorting order

From: Robert Voinea <robert(dot)voinea(at)topex(dot)ro>
To: pgsql-admin(at)postgresql(dot)org
Cc: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Subject: Re: Weird sorting order
Date: 2010-07-19 05:23:13
Message-ID: 201007190823.14092.robert.voinea@topex.ro (view raw or flat)
Thread:
Lists: pgsql-admin
On Friday 16 July 2010 18:34:06 Kevin Grittner wrote:
> Robert Voinea <robert(dot)voinea(at)topex(dot)ro> wrote:
> > Why is it that when running the query:
> > 
> > SELECT * FROM test ORDER BY val;
> > 
> > I get the following result?
> > 
> >  id |  val
> > 
> > ----+-------
> > 
> >   1 | 200
> >   2 | 201
> >   3 | 202
> >   4 | 203
> >   5 | 210
> >   6 | 211
> >   7 | 2##23
> >   8 | 2##24
> >   9 | 2##25
> >  
> >  10 | 2##33
> >  11 | ##26
> >  12 | 2ff
> >  13 | ##31
> >  14 | ##32
> >  15 | ##34
> > 
> > (15 rows)
> > 
> > Shouldn't value '2ff' be placed right after '211' but before
> > '2##23'?
> 
> That depends on your collation configuration.  What do you get
> from?:
> 
> show lc_collate;
> 
> In many collations, special characters such as '#' are ignored.

=> show lc_collate;
 lc_collate  
-------------
 en_US.UTF-8

-- 
Robert Voinea <robert (dot) voinea (at) topex (dot) ro>
Software Developer
Phone: +40 21 408 38 00 / ext. 343
Fax: +40 21 408 38 08
Local time: GMT+2
http://www.topex.ro


In response to

Responses

pgsql-admin by date

Next:From: Kevin GrittnerDate: 2010-07-19 14:11:39
Subject: Re: Weird sorting order
Previous:From: Vaughn, Adam (IMS)Date: 2010-07-18 15:04:14
Subject: replication recommendation

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