Re: ORDER BY 'criteria'

From: Dennis Gearon <gearond(at)cvc(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ian Barwick <barwick(at)gmx(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: ORDER BY 'criteria'
Date: 2003-01-24 12:24:54
Message-ID: 3E313096.B86D1F86@cvc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I think I will write a custom C function in the future this year, that
writes a replacement value into a designated query result column that
can be the target of a binary ORDER BY based on translation from a
collation table.

Don't know how the pictogram languages work, (old egyptian, modern
chinese, korean, japanese, others), but the character based languages
would sort fine.

Example

create table ctrys_in_all_languages( -- not syntactically correct below
ID int4 primary key,
iso_lang_code blob,
ctry_name blob );

fill table; -- pseudo code

select ctry_name, sorting_column = ' function here (ctry_name, 'fr')'
from ctrys_in_all_languages
where ( iso_lang_code = 'fr' )
order by sorting_column;

discard ctry_name;
--

Carpe Dancem ;-)
-----------------------------------------------------------------
Remember your friends while they are alive
-----------------------------------------------------------------
Sincerely, Dennis Gearon

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Renê Salomão 2003-01-24 12:25:01 Re: Pg 7.3.1 & DBD::Pg 1.21
Previous Message Dennis Gearon 2003-01-24 12:11:12 Re: I was spoiled by the MySQL timestamp field