From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: pgsql-admin@postgresql.org
To: Robert Voinea <robert.voinea@topex.ro>
Subject: Re: Weird sorting order
Date: Fri, 16 Jul 2010 10:34:06 -0500
Message-ID: <4C40359E0200002500033711@gw.wicourts.gov> (raw)
In-Reply-To: <201007161514.09960.robert.voinea@topex.ro>
References: <201007161514.09960.robert.voinea@topex.ro>
Robert Voinea <robert.voinea@topex.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.
-Kevin
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, robert.voinea@topex.ro
Subject: Re: Weird sorting order
In-Reply-To: <4C40359E0200002500033711@gw.wicourts.gov>
References: <201007161514.09960.robert.voinea@topex.ro> <4C40359E0200002500033711@gw.wicourts.gov>
* 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