interesting finding on order by behaviour

From: Samuel Hwang <samuel(at)replicon(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: interesting finding on order by behaviour
Date: 2011-07-22 17:11:21
Message-ID: 624925e3-6347-4475-b243-d1020e8a4700@p29g2000pre.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I ran the same tests in SQL Server 2008R2, Oracle10 and PostgreSQL
9.0.4 and found something interesting...

set up
=====
drop table t1
create table t1 (f1 varchar(100))
insert into t1 (f1) values ('AbC')
insert into t1 (f1) values ('CdE')
insert into t1 (f1) values ('abc')
insert into t1 (f1) values ('ABc')
insert into t1 (f1) values ('cde')

test
===
select * from t1 order by f1
select min(f1) as min, max(f1) as max from t1

results
=====
SQL Server 2008 R2 (with case insensitive data, the ordering follows
ASCII order)

f1
---
AbC
abc
ABc
cde
CdE

min max
------ -------
AbC CdE

Oracle 10 (data is case-sensitive, the ordering follows ASCII order)

f1
---
ABc
AbC
CdE
abc
cde

min max
------ -------
ABc cde

PostgreSQL 9.0.4 (data is case-sensitive, the ordering is ...
DIFFERENT)

f1
---
abc
AbC
ABc
cde
CdE

min max
------ -------
abc CdE

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Reid Thompson 2011-07-22 17:36:05 Re: interesting finding on order by behaviour
Previous Message Ilia Lilov 2011-07-22 15:45:30 Locking several tables within one transaction