Thread: Chaning locale sorting order for statements
Hello, is it possible to change the locale sorting order in statements ? I need this for a multilingual web application, where I'm not able to set the locale in the session or elsewhere. In Oracle I would use something like that : SELECT * FROM table1 ORDER BY NLSSORT(column1, 'NLS_SORT=FRENCH'); Does postgres has something similar ? Thx berger
Uz.ytkownik Albrecht Berger napisa?: > In Oracle I would use something like that : > SELECT * FROM table1 > ORDER BY NLSSORT(column1, 'NLS_SORT=FRENCH'); > > Does postgres has something similar ? I think, you have to create function NLSSORT by your own. C language would be nice for performance. It is possible to create operator which compares two strings, but I don't know how to tell him what the language is used now. Regards, Tomasz Myrta
I am not sure about comparation performance. I have big problems with sort performance in pg by comparing varchar. Also I am not sure if it is possible to get this new funktion to replace the standart sort. regards, Ivan. Tomasz Myrta wrote: > Uz.ytkownik Albrecht Berger napisa?: > > In Oracle I would use something like that : > > SELECT * FROM table1 > > ORDER BY NLSSORT(column1, 'NLS_SORT=FRENCH'); > > > > Does postgres has something similar ? > I think, you have to create function NLSSORT by your own. > C language would be nice for performance. > It is possible to create operator which compares two strings, but I > don't know how to tell him what the language is used now. > Regards, > Tomasz Myrta > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html