dbTalk Databases Forums  

[BUGS] BUG #2231: Incorrect Order By

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2231: Incorrect Order By in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Garoso, Fernando
 
Posts: n/a

Default [BUGS] BUG #2231: Incorrect Order By - 02-02-2006 , 05:06 PM







The following bug has been logged online:

Bug reference: 2231
Logged by: Garoso, Fernando
Email address: fgaroso (AT) ig (DOT) com.br
PostgreSQL version: 8.x
Operating system: GNU Linux Debian
Description: Incorrect Order By
Details:

create table tmp ( name char(30) );
create index tmp_idx on tmp (name);
insert into tmp values ( 'SUEKO' );
insert into tmp values ( 'SUE E' );
insert into tmp values ( 'SUE T' );

select * from tmp order by name;


### Result ###

teste=# select * from tmp order by name desc;
name
--------------------------------
SUE T
SUEKO
SUE E
(3 registros)

### Note ###

Version for windows => OK Order

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply With Quote
  #2  
Old   
Stephan Szabo
 
Posts: n/a

Default Re: [BUGS] BUG #2231: Incorrect Order By - 02-02-2006 , 05:10 PM






On Wed, 1 Feb 2006, Garoso, Fernando wrote:

Quote:
The following bug has been logged online:

Bug reference: 2231
Logged by: Garoso, Fernando
Email address: fgaroso (AT) ig (DOT) com.br
PostgreSQL version: 8.x
Operating system: GNU Linux Debian
Description: Incorrect Order By
Details:

create table tmp ( name char(30) );
create index tmp_idx on tmp (name);
insert into tmp values ( 'SUEKO' );
insert into tmp values ( 'SUE E' );
insert into tmp values ( 'SUE T' );

select * from tmp order by name;


### Result ###

teste=# select * from tmp order by name desc;
name
--------------------------------
SUE T
SUEKO
SUE E
(3 registros)
What locale are you using? The above looks correct to my eye for en_US
locale on most linux systems which use dictionary sorting.

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
  #3  
Old   
Stephan Szabo
 
Posts: n/a

Default Re: [BUGS] BUG #2231: Incorrect Order By - 02-02-2006 , 05:13 PM




On Thu, 2 Feb 2006, Stephan Szabo wrote:

Quote:
On Wed, 1 Feb 2006, Garoso, Fernando wrote:


The following bug has been logged online:

Bug reference: 2231
Logged by: Garoso, Fernando
Email address: fgaroso (AT) ig (DOT) com.br
PostgreSQL version: 8.x
Operating system: GNU Linux Debian
Description: Incorrect Order By
Details:

create table tmp ( name char(30) );
create index tmp_idx on tmp (name);
insert into tmp values ( 'SUEKO' );
insert into tmp values ( 'SUE E' );
insert into tmp values ( 'SUE T' );

select * from tmp order by name;


### Result ###

teste=# select * from tmp order by name desc;
name
--------------------------------
SUE T
SUEKO
SUE E
(3 registros)

What locale are you using? The above looks correct to my eye for en_US
locale on most linux systems which use dictionary sorting.
Hit send accidentally. Dictionary sorting rules generally skip spaces
in first pass comparisons. If you're expecting byte order sorting, you'll
want "C" locale. We currently use the system locales for sorting, so if
you want something which say uses non-byte order sorting but also doesn't
skip spaces, you'd need such a locale definition for the system.


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.