Re: is this a bug or I am blind? - Mailing list pgsql-general

From Lincoln Yeoh
Subject Re: is this a bug or I am blind?
Date
Msg-id 5.2.1.1.1.20051217212127.02b8cda0@localhost
Whole thread Raw
In response to Re: is this a bug or I am blind?  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
List 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.


pgsql-general by date:

Previous
From: Jerry Sievers
Date:
Subject: ...
Next
From: Leonel Nunez
Date:
Subject: Re: DBlink documentation