BUG #1028: order by problem

From: "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1028: order by problem
Date: 2003-12-24 18:58:43
Message-ID: 20031224185843.30EDBCF8772@www.postgresql.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 1028
Logged by: William H Copson

Email address: copson(at)u(dot)arizona(dot)edu

PostgreSQL version: 7.4

Operating system: Redhat 7.2 (highly modified)

Description: order by problem

Details:

Sorry, in the previoius submission I forgot to change the
PostgreSQL version above. I have 7.4, not 7.5 Dev.

The following:

drop table tst;
create table tst (
name varchar(25));
insert into tst values ('LEE,ADAM');
insert into tst values ('LEEBERMAN,JOHN');
insert into tst values ('LEE,RALPH');
select name from tst order by name;

Produces the following output:

DROP TABLE
CREATE TABLE
INSERT 3307587 1
INSERT 3307588 1
INSERT 3307589 1
name
----------------
LEE,ADAM
LEEBERM AN,JOHN
LEE,RALPH
(3 rows)

Expected output:
name
----------------
LEE,ADAM
LEE,RALPH
LEEBERM AN,JOHN
(3 rows)

I have tried databases with SQL_ASCII, LATIN1 and LATIN2
encoding with the same result. From this small example
and others involving an employee table (80K+ records) it appears that the
comma is being parsed out prior to the
sort (i.e. 'LEEB' sorts after 'LEEA' and before 'LEER').

Browse pgsql-bugs by date

  From Date Subject
Next Message ezra epstein 2003-12-25 00:44:44 %ROWTYPE in RETURNS clause of CREATE FUNCTION statement causes a parser error. Postges 7.4 & 7.4.1
Previous Message PostgreSQL Bugs List 2003-12-24 18:51:43 BUG #1027: incorrect result from 'order by'