Re: is this a bug or I am blind?

From: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Mage <mage(at)mage(dot)hu>, pgsql-general(at)postgreSQL(dot)org, Greg Stark <gsstark(at)mit(dot)edu>
Subject: Re: is this a bug or I am blind?
Date: 2005-12-17 13:49:18
Message-ID: 5.2.1.1.1.20051217212127.02b8cda0@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

At 11:49 AM 12/17/2005 +0800, Lincoln Yeoh wrote:
>But in a column for license owner names, one might want "tty" and "tyty"
>to be the same - one might have to have a multicolumn index depending on
>the owner's locale of choice.

To make myself clear, one might want to store a person's name in one column
and the locale it belongs to in another column.

I wondering whether it is possible to have something like this:

create table ppl_people (
id serial,
locale text,
name text
);

create index idx_ppl_locale_name on ppl_people
( locale,smash(locale,name))

Then one could do:

select * from ppl_people where
locale=$locale
and smash(locale,name) between smash($locale,$start) and smash($locale,$end)
order by smash(locale,name)

Not sure if that is correct, but hope you can understand me anyway.

Would something like this be possible using the standard SQL syntax and the
COLLATE feature?

Or am I thinking of doing things the wrong way, and there's a better or
more standard way?

Regards,
Link.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Leonel Nunez 2005-12-17 14:04:46 Re: DBlink documentation
Previous Message Andre Truter 2005-12-17 13:44:23 Re: DBlink documentation