ORDER BY is case insensitive - Mailing list pgsql-sql

From Bryan White
Subject ORDER BY is case insensitive
Date
Msg-id AANLkTimupyTgU-h-LKkV9VprzFopMMBKqsoO2RVpAzgL@mail.gmail.com
Whole thread Raw
Responses Re: ORDER BY is case insensitive
Re: ORDER BY is case insensitive
List pgsql-sql
I was suprised to find out that ORDER BY is case insensitive.  Is
there a way to do a case sensitive ORDER BY clause?

This transcript demonstrates what I am seeing:

$ createdb bryan
$ psql bryan
psql (8.4.4)
Type "help" for help.

bryan=# create table t (f text);
CREATE TABLE
bryan=# insert into t (f) values ('a');
INSERT 0 1
bryan=# insert into t (f) values ('b');
INSERT 0 1
bryan=# insert into t (f) values ('c');
INSERT 0 1
bryan=# insert into t (f) values ('B');
INSERT 0 1
bryan=# select * from t order by f;f
---abBc
(4 rows)

bryan=# \q
~  $ psql -l                                    List of databases     Name       |  Owner   | Encoding |  Collation  |
 Ctype    |
 
Access privileges
-----------------+----------+----------+-------------+-------------+-----------------------bryan           | bryan    |
UTF8    | en_US.UTF-8 | en_US.UTF-8 |postgres        | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |template0
|postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
       :
 
postgres=CTc/postgrestemplate1       | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                             :
 
postgres=CTc/postgres
(4 rows)



-- 
Bryan White


pgsql-sql by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: How to Insert and retrieve multilingual (Hindi "an Indian language") into PostgreSQL
Next
From: Gerardo Herzig
Date:
Subject: Re: ORDER BY is case insensitive