> Why not do it the other way around?
> es_ES spanish
> Spanish_Spain spanish
> ru_RU russian
> pt_BR portuguese_brazil
>
> That way you don't need any funny index. Or do you need the list of
> locales for each language? (but even if you do, you can easily obtain it
> by indexing both columns separately using btrees anyway)
Yes, that's possible but that icreases number of identical configuration:
russian_win Russian_Russia
russian_unix ru_RU
They doesn't differ except locale name.