Skip site navigation (1) Skip section navigation (2)

Re: ORDER BY collation order

From: Joe <dev(at)freedomcircle(dot)net>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: ORDER BY collation order
Date: 2008-09-21 14:58:47
Message-ID: 48D66127.9060107@freedomcircle.net (view raw or flat)
Thread:
Lists: pgsql-sql
Hi Scott,

Scott Marlowe wrote:
> Sorry, I mentioned the wrong operator before, it's ~>~ and ~<~ (asc
> versus desc):
>
> smarlowe=# create table col_test (a text);
> CREATE TABLE
> smarlowe=# insert into col_test (a) values ('"quoted"'),('Abc'),('123');
> INSERT 0 3
> smarlowe=# select * from col_test order by a;
>     a
> ----------
>  123
>  Abc
>  "quoted"
> (3 rows)
>
> smarlowe=# select * from col_test order by a using ~<~;
>     a
> ----------
>  "quoted"
>  123
>  Abc
> (3 rows)
>
> smarlowe=# select * from col_test order by a using ~>~;
>     a
> ----------
>  Abc
>  123
>  "quoted"
> (3 rows)

Those operators give me "C"-style collation in the database that is 
using "en_US" collation, but what I would really prefer is the reverse.  
BTW, where are those operators documented?  Neither Google nor Yahoo nor 
postgresql.org search return anything.

Joe

In response to

pgsql-sql by date

Next:From: Marc MaminDate: 2008-09-22 10:55:24
Subject: varchar::timezone conversion
Previous:From: Scott MarloweDate: 2008-09-19 14:26:00
Subject: Re: ORDER BY collation order

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group