pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tjk@tksoft.com <tjk@tksoft.com>
To: eroloz@bilgi.edu.tr
Cc: pgsql-sql@postgresql.org
Subject: Re: Localization or an other solution
Date: Wed, 12 Apr 2000 16:14:30 -0700 (PDT)
Message-ID: <200004122314.QAA22443@uno.tksoft.com> (raw)
In-Reply-To: <38F4F721.8F78C4C5@bilgi.edu.tr>

Erol,

A possible solution would be to create special functions
for sorting each language you need to sort.

E.g. sortturkish() for sorting Turkish text.

You would implement sortturkish by writing a C
function.

You would need to do string comparisons of Turkish
language strings within the function.

In terms of more specifics, I hope you are more knowleadgeable.
I don't know one thing about Turkish, so I can't make
real attempts. If you just have some 8 bit characters
which are special, then the jobs is relatively simple. 
Read each letter one at a time and use a lookup
table which has a value assigned to all Turkish letters,
for doing the comparison. 

I am curious if anyone else thinks using functions would
be more flexible/convenient. You couldn't handle issues such
as numbers, commas, etc., but sorting alone would be useful.

Not perfect, but convenient, especially when your primary
language is English and you only want to be able to
handle some tables with text in other languages. 


Troy




> 
> Hi,
> As everybody knows, or at least guess, the Turkish-specific characters
> is ordered incorrectly unless you don't have localization support. (For
> example there is a letter like 's' but has a dot under it; this letter
> must come after 's'; without localization support this and other
> non-English ones come after 'z' )
> According to the manual, localization causes the loose of performance.
> Beside, I scare to use localization which is not familiar to me. Because
> of these, I try to find an other solution. The one that I think on is
>  - to use a seperate field for each of the fields that I want to order;
>  - to put a correctly-sortable version of the data in the related field
>  - and to use this extra fields for sorting purposes.
> Example:
> Original data: 'þimþek'
> In extra field: 'szzimszzek'
> Finally, my question is:
> In a table which has 100.000 or more records, which one will be more
> faster? Localization or this one.
> Thanks in advance
> Erol Oz
> 
> 




view thread (4+ messages)  latest in thread

Message-ID: <200004122314.QAA22443@uno.tksoft.com>
Permalink:  ../200004122314.QAA22443@uno.tksoft.com/
Also on:    postgresql.org/message-id/200004122314.QAA22443@uno.tksoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tjk@tksoft.com, eroloz@bilgi.edu.tr
  Subject: Re: Localization or an other solution
  In-Reply-To: <200004122314.QAA22443@uno.tksoft.com>
  References: <38F4F721.8F78C4C5@bilgi.edu.tr> <200004122314.QAA22443@uno.tksoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox