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

Re: BUG #2314: The Order changed?

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: "L(dot)Jumadi" <j0e(at)telkom(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2314: The Order changed?
Date: 2006-03-15 23:26:21
Message-ID: 20060315152235.Y69512@megazone.bigpanda.com (view raw or flat)
Thread:
Lists: pgsql-bugs
On Sun, 12 Mar 2006, L.Jumadi wrote:

>
> The following bug has been logged online:
>
> Bug reference:      2314
> Logged by:          L.Jumadi
> Email address:      j0e(at)telkom(dot)net
> PostgreSQL version: 8.1.3
> Operating system:   SimplyMepis 3.4.3 with kernel 2.6.15.2
> Description:        The Order changed?
> Details:
>
> I have a table named test with field like this:
> ocode varchar(8), code varchar(8) with primary key
> at ocode.With data like this:
> ocode   code
> 'test'    '-0'
> 'test'    '-1'
> 'test'    '1'
> 'test'    '2'
> I give the command in the psql like this:
> SELECT * FROM test ORDER BY code;
> the result is like this:
> ocode   code
> test    -0
> test    1
> test    -1
> test    2
> When I use 8.0.1 version this command gives me result
> like this
> ocode   code
> test    -0
> test    -1
> test    1
> test    2
> The question is this a bug?or there is changes in the
> way postgreSQL order the field? Thank's in advance

The most likely explanation is that the locale choice at initdb time for
the two versions was different.  The 8.0 result looks consistent with "C"
locale and the 8.1 with some others (like en_US).

For example:
[sszabo(at)dev test]$ cat file
-0
-1
1
2
[sszabo(at)dev test]$ LANG="C" sort file
-0
-1
1
2
[sszabo(at)dev test]$ LANG="en_US" sort file
-0
1
-1
2

In response to

pgsql-bugs by date

Next:From: Stephan SzaboDate: 2006-03-15 23:28:46
Subject: Re: BUG #2317: Wrong sorting order for (VW)
Previous:From: Joe SundayDate: 2006-03-15 21:35:57
Subject: Re: Large join runs out of memory in 8.1

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