Unix Technical Forum

Re: BUG #2314: The Order changed?

This is a discussion on Re: BUG #2314: The Order changed? within the pgsql Bugs forums, part of the PostgreSQL category; --> On Sun, 12 Mar 2006, L.Jumadi wrote: > > The following bug has been logged online: > > Bug ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 09:49 AM
Stephan Szabo
 
Posts: n/a
Default Re: BUG #2314: The Order changed?

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@telkom.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@dev test]$ cat file
-0
-1
1
2
[sszabo@dev test]$ LANG="C" sort file
-0
-1
1
2
[sszabo@dev test]$ LANG="en_US" sort file
-0
1
-1
2

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:51 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com